section (n) —
Section numbers are a sequence of integers p n, sub> which represent the number of different ways of representing n as a sum of natural numbers (with no important order). The generating function for p n is defined as —
Syntax: partition (n)
n - It denotes the number upto which partition number is to be calculated.
Returns: Returns the n th partition number.
Example # 1:
Value of n = 7 Value of nth partition number: 15
Example # 2:
Value of n = 10 N partition number are: [1, 2, 3, 5, 7, 11, 15, 22, 30, 42]