partitions
partitions n
-- returns a list of the partitions of the integer n.
partitions(n,k)
-- returns a list of the partitions of the integer n
into terms each of which does not exceed k.
i1 = partitions 4
o1 = {{4},{3,1},{2,2},{2,1,1},{1,1,1,1}}
o1 : List
i2 = partitions(4,2)
o2 = {{2,2},{2,1,1},{1,1,1,1}}
o2 : List
Go to main index.
Go to concepts index.