Skip to content
Related Articles

Related Articles

Improve Article

Python | sympy partitions.RGS_enum() method

  • Last Updated : 27 Aug, 2019

With the help of sympy.combinatorics.partitions.RGS_enum() method, we can get the total number unrestricted growth string of size m by using sympy.combinatorics.partitions.RGS_enum() method.

Syntax : sympy.combinatorics.partitions.RGS_enum(m)
Return : Return a total number of unrestricted growth string.

Example #1 :
In this example we can see that by using sympy.combinatorics.partitions.RGS_enum() method, we are able to get the total number of unrestricted growth string of size m.




# import sympy and RGS_generalized
from sympy.combinatorics.partitions import RGS_enum
from sympy import *
    
# Using sympy.combinatorics.partitions.RGS_enum() method
gfg = RGS_enum(5)
  
print(gfg)

Output :

52



Example #2 :




# import sympy and RGS_generalized
from sympy.combinatorics.partitions import RGS_enum
from sympy import *
    
# Using sympy.combinatorics.partitions.RGS_enum() method
gfg = RGS_enum(16)
  
print(gfg)

Output :

10480142147

 Attention geek! Strengthen your foundations with the Python Programming Foundation Course and learn the basics.  

To begin with, your interview preparations Enhance your Data Structures concepts with the Python DS Course. And to begin with your Machine Learning Journey, join the Machine Learning – Basic Level Course

My Personal Notes arrow_drop_up
Recommended Articles
Page :