With the help of sympy.partition() method, we can find Partition number in SymPy.
The Partition numbers are a sequence of integers pn that represent the number of distinct ways of representing n as a sum of natural numbers (with order irrelevant). The generating function for pn is given by –
n – It denotes the number upto which partition number is to be calculated.
Returns: Returns the nth partition number.
Value of n = 7 Value of nth partition number : 15
Value of n = 10 N partition number are : [1, 2, 3, 5, 7, 11, 15, 22, 30, 42]
- class method vs static method in Python
- Python | set() method
- Python | os.dup() method
- Python | next() method
- Python | after method in Tkinter
- Python | sys.getrecursionlimit() method
- Python PIL | eval() method
- Python | sympy.rf() method
- Python | os.readlink() method
- Python | os.getpgid() method
- Python | sys.getdefaultencoding() method
- Python | os.tcgetpgrp() method
- Python PIL | ImagePalette() Method
- Python | sympy.ff() method
- Python | sympy.nT() method
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.