
In
number theory
Number theory is a branch of pure mathematics devoted primarily to the study of the integers and arithmetic functions. Number theorists study prime numbers as well as the properties of mathematical objects constructed from integers (for example ...
, the partition function represents the
number
A number is a mathematical object used to count, measure, and label. The most basic examples are the natural numbers 1, 2, 3, 4, and so forth. Numbers can be represented in language with number words. More universally, individual numbers can ...
of possible
partitions of a non-negative integer . For instance, because the integer 4 has the five partitions , , , , and .
No
closed-form expression
In mathematics, an expression or equation is in closed form if it is formed with constants, variables, and a set of functions considered as ''basic'' and connected by arithmetic operations (, and integer powers) and function composition. ...
for the partition function is known, but it has both
asymptotic expansions that accurately approximate it and
recurrence relation
In mathematics, a recurrence relation is an equation according to which the nth term of a sequence of numbers is equal to some combination of the previous terms. Often, only k previous terms of the sequence appear in the equation, for a parameter ...
s by which it can be calculated exactly. It grows as an
exponential function of the
square root
In mathematics, a square root of a number is a number such that y^2 = x; in other words, a number whose ''square'' (the result of multiplying the number by itself, or y \cdot y) is . For example, 4 and −4 are square roots of 16 because 4 ...
of its argument. The
multiplicative inverse
In mathematics, a multiplicative inverse or reciprocal for a number ''x'', denoted by 1/''x'' or ''x''−1, is a number which when Multiplication, multiplied by ''x'' yields the multiplicative identity, 1. The multiplicative inverse of a ra ...
of its
generating function is the
Euler function; by Euler's
pentagonal number theorem this function is an alternating sum of
pentagonal number
A pentagonal number is a figurate number that extends the concept of triangular number, triangular and square numbers to the pentagon, but, unlike the first two, the patterns involved in the construction of pentagonal numbers are not rotational ...
powers of its argument.
Srinivasa Ramanujan first discovered that the partition function has nontrivial patterns in
modular arithmetic
In mathematics, modular arithmetic is a system of arithmetic operations for integers, other than the usual ones from elementary arithmetic, where numbers "wrap around" when reaching a certain value, called the modulus. The modern approach to mo ...
, now known as
Ramanujan's congruences. For instance, whenever the decimal representation of ends in the digit 4 or 9, the number of partitions of will be divisible by 5.
Definition and examples
For a positive integer , is the number of distinct ways of representing as a
sum of positive integers. For the purposes of this definition, the order of the terms in the sum is irrelevant: two sums with the same terms in a different order are not considered to be distinct.
By convention , as there is one way (the
empty sum) of representing zero as a sum of positive integers. Furthermore when is negative.
The first few values of the partition function, starting with , are:
Some exact values of for larger values of include:
Generating function

The
generating function for ''p''(''n'') is given by
The equality between the products on the first and second lines of this formula
is obtained by expanding each factor
into the
geometric series
In mathematics, a geometric series is a series (mathematics), series summing the terms of an infinite geometric sequence, in which the ratio of consecutive terms is constant. For example, 1/2 + 1/4 + 1/8 + 1/16 + ⋯, the series \tfrac12 + \tfrac1 ...
To see that the expanded product equals the sum on the first line,
apply the
distributive law
In mathematics, the distributive property of binary operations is a generalization of the distributive law, which asserts that the equality
x \cdot (y + z) = x \cdot y + x \cdot z
is always true in elementary algebra.
For example, in elementary ...
to the product. This expands the product into a sum of
monomial
In mathematics, a monomial is, roughly speaking, a polynomial which has only one term. Two definitions of a monomial may be encountered:
# A monomial, also called a power product or primitive monomial, is a product of powers of variables with n ...
s of the form
for some sequence of coefficients
, only finitely many of which can be non-zero.
The exponent of the term is
, and this sum can be interpreted as a representation of
as a partition into
copies of each number
. Therefore, the number of terms of the product that have exponent
is exactly
, the same as the coefficient of
in the sum on the left.
Therefore, the sum equals the product.
The function that appears in the denominator in the third and fourth lines of the formula is the
Euler function. The equality between the product on the first line and the formulas in the third and fourth lines is Euler's
pentagonal number theorem.
The exponents of
in these lines are the
pentagonal number
A pentagonal number is a figurate number that extends the concept of triangular number, triangular and square numbers to the pentagon, but, unlike the first two, the patterns involved in the construction of pentagonal numbers are not rotational ...
s
for
(generalized somewhat from the usual pentagonal numbers, which come from the same formula for the positive values The pattern of positive and negative signs in the third line comes from the term
in the fourth line: even choices of
produce positive terms, and odd choices produce negative terms.
More generally, the generating function for the partitions of
into numbers selected from a set
of positive integers can be found by taking only those terms in the first product for which
. This result is due to
Leonhard Euler
Leonhard Euler ( ; ; ; 15 April 170718 September 1783) was a Swiss polymath who was active as a mathematician, physicist, astronomer, logician, geographer, and engineer. He founded the studies of graph theory and topology and made influential ...
. The formulation of Euler's generating function is a special case of a
-Pochhammer symbol and is similar to the product formulation of many
modular form
In mathematics, a modular form is a holomorphic function on the complex upper half-plane, \mathcal, that roughly satisfies a functional equation with respect to the group action of the modular group and a growth condition. The theory of modul ...
s, and specifically the
Dedekind eta function.
Recurrence relations
The same sequence of pentagonal numbers appears in a
recurrence relation
In mathematics, a recurrence relation is an equation according to which the nth term of a sequence of numbers is equal to some combination of the previous terms. Often, only k previous terms of the sequence appear in the equation, for a parameter ...
for the partition function:
As base cases,
is taken to equal
, and
is taken to be zero for negative
. Although the sum on the right side appears infinite, it has only finitely many nonzero terms,
coming from the nonzero values of
in the range
The recurrence relation can also be written in the equivalent form
Another recurrence relation for
can be given in terms of the
sum of divisors function :
If
denotes the number of partitions of
with no repeated parts then it follows by splitting each partition into its even parts and odd parts, and dividing the even parts by two, that
Congruences
Srinivasa Ramanujan is credited with discovering that the partition function has nontrivial patterns in
modular arithmetic
In mathematics, modular arithmetic is a system of arithmetic operations for integers, other than the usual ones from elementary arithmetic, where numbers "wrap around" when reaching a certain value, called the modulus. The modern approach to mo ...
.
For instance the number of partitions is divisible by five whenever the decimal representation of
ends in the digit 4 or 9, as expressed by the congruence
For instance, the number of partitions for the integer 4 is 5.
For the integer 9, the number of partitions is 30; for 14 there are 135 partitions. This congruence is implied by the more general identity
also by Ramanujan, where the notation
denotes the product defined by
A short proof of this result can be obtained from the partition function generating function.
Ramanujan also discovered congruences modulo 7 and 11:
The first one comes from Ramanujan's identity
Since 5, 7, and 11 are consecutive
primes, one might think that there would be an analogous congruence for the next prime 13,
for some . However, there is no congruence of the form
for any prime ''b'' other than 5, 7, or 11. Instead, to obtain a congruence, the argument of
should take the form
for some
. In the 1960s,
A. O. L. Atkin of the
University of Illinois at Chicago discovered additional congruences of this form for small prime moduli. For example:
proved that there are such congruences for every prime modulus greater than 3. Later, showed there are partition congruences modulo every integer
coprime
In number theory, two integers and are coprime, relatively prime or mutually prime if the only positive integer that is a divisor of both of them is 1. Consequently, any prime number that divides does not divide , and vice versa. This is equiv ...
to 6.
Approximation formulas
Approximation formulas exist that are faster to calculate than the exact formula given above.
An
asymptotic
In analytic geometry, an asymptote () of a curve is a line such that the distance between the curve and the line approaches zero as one or both of the ''x'' or ''y'' coordinates Limit of a function#Limits at infinity, tends to infinity. In pro ...
expression for ''p''(''n'') is given by
:
as
.
This
asymptotic formula was first obtained by
G. H. Hardy
Godfrey Harold Hardy (7 February 1877 – 1 December 1947) was an English mathematician, known for his achievements in number theory and mathematical analysis. In biology, he is known for the Hardy–Weinberg principle, a basic principle of pop ...
and
Ramanujan in 1918 and independently by
J. V. Uspensky in 1920. Considering
, the asymptotic formula gives about
, reasonably close to the exact answer given above (1.415% larger than the true value).
Hardy and Ramanujan obtained an
asymptotic expansion
In mathematics, an asymptotic expansion, asymptotic series or Poincaré expansion (after Henri Poincaré) is a formal series of functions which has the property that truncating the series after a finite number of terms provides an approximation ...
with this approximation as the first term:
where
Here, the notation
means that the sum is taken only over the values of
that are
relatively prime
In number theory, two integers and are coprime, relatively prime or mutually prime if the only positive integer that is a divisor of both of them is 1. Consequently, any prime number that divides does not divide , and vice versa. This is equiv ...
to
. The function
is a
Dedekind sum.
The error after
terms is of the order of the next term, and
may be taken to be of the order of
. As an example, Hardy and Ramanujan showed that
is the nearest integer to the sum of the first
terms of the series.
In 1937,
Hans Rademacher was able to improve on Hardy and Ramanujan's results by providing a
convergent series expression for
. It is
The proof of Rademacher's formula involves
Ford circles,
Farey sequences,
modular symmetry and the
Dedekind eta function.
It may be shown that the
th term of Rademacher's series is of the order
so that the first term gives the Hardy–Ramanujan asymptotic approximation.
published an elementary proof of the asymptotic formula for
.
Techniques for implementing the Hardy–Ramanujan–Rademacher formula efficiently on a computer are discussed by , who shows that
can be computed in time
for any
. This is near-optimal in that it matches the number of digits of the result. The largest value of the partition function computed exactly is
, which has slightly more than 11 billion digits.
Strict partition function
Definition and properties
A partition in which no part occurs more than once is called ''strict'', or is said to be a partition ''into distinct parts''. The function ''q''(''n'') gives the number of these strict partitions of the given sum ''n''. For example, ''q''(3) = 2 because the partitions 3 and 1 + 2 are strict, while the third partition 1 + 1 + 1 of 3 has repeated parts. The number ''q''(''n'') is also equal to the number of partitions of ''n'' in which only odd summands are permitted.
Generating function
The generating function for the numbers ''q''(''n'') is given by a simple infinite product:
where the notation
represents the
Pochhammer symbol From this formula, one may easily obtain the first few terms :
This series may also be written in terms of
theta functions as
where
and
In comparison, the generating function of the regular partition numbers ''p''(''n'') has this identity with respect to the theta function:
Identities about strict partition numbers
Following identity is valid for the Pochhammer products:
:
From this identity follows that formula:
: