|
|
Each partition is a basic list of type Partition.
|
|
|
|
For ordered lists of exactly k nonnegative integers that sum to n, use compositions instead. In the following example, we create Partition objects from the output of compositions to find all the partitions of 10, of length exactly 4, with no part greater than 5.
|
|
|
If partitions n is called on a negative integer n, an empty list is returned. If a negative integer is given for k, it will cause an error.
The object partitions is a method function.