Generates all possible (unique) ways to represent a positive integer n as sum of positive integers.
Usage
intPart(n)
Arguments
n
integer
Value
list
all partitions of n
Details
A partition of an integer n is a sequence of weakly increasing integers such that their sum returns n.
The function generates all the partitions of a given integer in sorted order and numbers within a partition in sorted order too.
References
Nijenhuis A. and Wilf. H., Combinatorial Algorithms for Computers and Calculators. Academic Press, Orlando FL, II edition,
1978.