gives the number p(n) of unrestricted partitions of the integer n.


  • Integer mathematical function, suitable for both symbolic and numerical manipulation.
  • PartitionsP automatically threads over lists.


open allclose all

Basic Examples  (2)

Plot the number of unrestricted partitions:

Scope  (3)

Compute the number of partitions for large numbers:

PartitionsP threads element-wise over lists:

TraditionalForm formatting:

Applications  (3)

Number of nonisomorphic Abelian groups of order n:

Compare to FiniteAbelianGroupCount:

Compare cumulative counts of even and odd partitions:

Visualize p-adic valuations of the number of partitions:

Properties & Relations  (4)

PartitionsP gives the length of IntegerPartitions:

Obtain values of PartitionsP from series expansion:

Use FullSimplify to simplify expressions containing PartitionsP:

FindSequenceFunction can recognize the PartitionsP sequence:

Possible Issues  (1)

PartitionsP evaluates only for integer arguments:

Use Simplify to find implicit integers in arguments:

Neat Examples  (2)

Successive differences of PartitionsP modulo 2:

A "random" walk based on PartitionsP:

Wolfram Research (1988), PartitionsP, Wolfram Language function,


Wolfram Research (1988), PartitionsP, Wolfram Language function,


@misc{reference.wolfram_2021_partitionsp, author="Wolfram Research", title="{PartitionsP}", year="1988", howpublished="\url{}", note=[Accessed: 13-June-2021 ]}


@online{reference.wolfram_2021_partitionsp, organization={Wolfram Research}, title={PartitionsP}, year={1988}, url={}, note=[Accessed: 13-June-2021 ]}


Wolfram Language. 1988. "PartitionsP." Wolfram Language & System Documentation Center. Wolfram Research.


Wolfram Language. (1988). PartitionsP. Wolfram Language & System Documentation Center. Retrieved from