Skip to content

PartitionsP

Number of unrestricted partitions of an integer.

$ wo 'PartitionsP[0]'
1
$ wo 'PartitionsP[10]'
42

Negative integers have no partitions:

$ wo 'PartitionsP[-3]'
0

PartitionsP is Listable and threads over lists:

$ wo 'PartitionsP[{4, 5, 6}]'
{5, 7, 11}

It stays unevaluated for non-integer arguments:

$ wo 'PartitionsP[3.5]'
PartitionsP[3.5]