Partitions of an integer
This functionality does not run in MATLAB.
cominat::partitions(n) returns the number
of partitions of the integer
A partition of a nonnegative integer
a non-increasing list of positive integers with total sum
There are 5 partitions of 4:
Counting is done efficiently with Euler's pentagonal formula for small values of n and Hardy-Ramanujan-Rademacher's formula otherwise.