gives the number q(n) of partitions of the integer n into distinct parts.


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


open allclose all

Basic Examples  (2)

Plot the number of restricted partitions:

Scope  (3)

Compute the number of partitions for large numbers:

PartitionsQ threads element-wise over lists:

TraditionalForm formatting:

Applications  (3)

Compare cumulative counts of even and odd partitions into distinct parts:

Plot the ratio of the number of partitions with its asymptotic value:

Visualize p-adic valuations of the number of partitions:

Properties & Relations  (3)

PartitionsQ gives the length of IntegerPartitions with nonrepeating parts:

Generate the explicit partitions:

Model PartitionsQ based on the definition:

FindSequenceFunction can recognize the PartitionsQ sequence:

Possible Issues  (1)

PartitionsQ evaluates only for explicit integers:

Use Simplify to find implicit integers in arguments:

Neat Examples  (2)

Successive differences of PartitionsQ modulo 2:

A "random" walk based on PartitionsQ:

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


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


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


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


@misc{reference.wolfram_2024_partitionsq, author="Wolfram Research", title="{PartitionsQ}", year="1988", howpublished="\url{}", note=[Accessed: 16-July-2024 ]}


@online{reference.wolfram_2024_partitionsq, organization={Wolfram Research}, title={PartitionsQ}, year={1988}, url={}, note=[Accessed: 16-July-2024 ]}