The partition function counts the partitions of
a nonnegative integer
into distinct positive integers.
It is also denoted
(Abramowitz and Stegun 1972, p. 825), with
for the empty partition
and
for negative integers
.
The related function gives the number of partitions
of
with
or
fewer addends, or equivalently, into partitions
with no element greater than
. This function is denoted
or
for nonnegative integers
and
. (Note that if "
or fewer" is changed to "exactly
" and "no element greater than
" to "greatest element equal to
," then the partition
function P of two arguments is obtained.)
The
such partitions can be enumerated in the Wolfram
Language using IntegerPartitions[n,
k].
For example, the partitions of 5 of which the largest member is
are
,
,
,
, and
. Similarly, the five partitions
of 5 into three or fewer parts are
,
,
,
, and
.
For positive integers and
,
satisfies the recurrence
relation
|
(1)
|
with ,
for
,
and
for
.
Also,
for
,
and
for
.
The number triangle of
, with rows
, 2, ... and columns
, ...,
, is given by
|
(2)
|
(OEIS A026820).
For example, ,
since the partitions of 10 into distinct parts are
,
,
,
,
,
,
,
,
,
and
.
The function
is implemented in the Wolfram Language
as PartitionsQ[n].
The values for ,
2, ... are 1, 1, 2, 2, 3, 4, 5, 6, 8, 10, ... (OEIS A000009).
The first few prime values of are for indices 3, 4, 5, 7, 22, 70, 100, 495, 1247, 2072,
320397, 3335367, 16168775, 37472505, 52940251, 78840125, 81191852, ... (OEIS A035359),
corresponding to values 2, 2, 3, 5, 89, 29927, 444793, 602644050950309, ... (OEIS
A051005), with no others up to
(M. Alekseyev, Jul. 10, 2015).
is also the number of partitions of
with odd parts, sometimes denoted
(Andrews 1998, p. 237).
The generating function for
, with
, is
|
(3)
| |||
|
(4)
| |||
|
(5)
| |||
|
(6)
| |||
|
(7)
| |||
|
(8)
|
where
and
are q-Pochhammer symbols.
This can also be interpreted as another form of the Jacobi triple product, written in terms of the Q-functions as
|
(9)
|
(Borwein and Borwein 1987, p. 64).
For ,
a recurrence relation is
|
(10)
|
where
is the divisor function,
|
(11)
|
and
|
(12)
|
for
is the odd divisor function giving the sum of odd divisors
of
:
1, 1, 4, 1, 6, 4, 8, ... (OEIS A000593; Abramowitz
and Stegun 1972, p. 826).
For ,
another recurrence relation is
|
(13)
|
where
is the floor function and
|
(14)
|
(E. Georgiadis, A. V. Sutherland, and K. S. Kedlaya; Sloane).
satisfies the inequality
|
(15)
|
for .
has the asymptotic formula
|
(16)
|
as
(Abramowitz and Stegun 1972, p. 826).
Guo and Zhang (2026) proved that is a logarithmically
convex sequence. More generally, for every real number
,
is eventually a logarithmically
convex sequence.
For ,
a Rademacher-like convergent series for
is given by
|
(17)
|
where
|
(18)
|
(Hagis 1964ab, 1965; P. J. Grabner, pers. comm., Sep. 10, 2003), where
means
and
are relatively prime,
|
(19)
|
is a Dedekind sum, is the floor function,
and
is the zeroth order Bessel function
of the first kind. The formula for
corrects Abramowitz and Stegun (1972, p. 825), who
erroneously use the analogous coefficient for
. The convergent series
for
can also be written explicitly as
|
(20)
|
where
is a generalized hypergeometric
function.
For nonnegative integers and
, let
denote the number of partitions
of
into exactly
distinct
parts. For example,
since there are four partitions
of 10 into three distinct parts:
,
,
, and
.
is given by
|
(21)
|
where
is the partition function P and
is a binomial
coefficient (Comtet 1974, p. 116). The following table gives the first few
values of
(OEIS A008289; Comtet 1974, pp. 115-116).
| 1 | 2 | 3 | 4 | |
| 1 | 1 | |||
| 2 | 1 | |||
| 3 | 1 | 1 | ||
| 4 | 1 | 1 | ||
| 5 | 1 | 2 | ||
| 6 | 1 | 2 | 1 | |
| 7 | 1 | 3 | 1 | |
| 8 | 1 | 3 | 2 | |
| 9 | 1 | 4 | 3 | |
| 10 | 1 | 4 | 4 | 1 |