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:

Introduced in 1988