On this page
Take the number 4. You can write it as 4, 3 + 1, 2 + 2, 2 + 1 + 1 or 1 + 1 + 1 + 1. That is five ways, as long as 3 + 1 and 1 + 3 count as the same sum. Each of these is a partition of 4, and the numbers being added are its parts.
In how many ways can a number be written as a sum of positive integers?
The number of partitions of n is written p(n). The OEIS entry A000041 lists p(1) to p(10) as 1, 2, 3, 5, 7, 11, 15, 22, 30 and 42.
p(100) = 190,569,292, according to the OEIS table of partition numbers.
No simple closed formula is known. In 1918 G. H. Hardy and Srinivasa Ramanujan published an approximation in Asymptotic Formulae in Combinatory Analysis; as the partition function article) states it, p(n) is close to e to the power π√(2n/3), divided by 4n√3. For n = 100 that gives about 199 million, under 5% too high.
How do you count partitions by hand without missing any?
Write each partition with parts in decreasing order, then group by the largest part. For n = 6:
Largest 6 or 5: 6, 5 + 1.
Largest 4: 4 + 2, 4 + 1 + 1.
Largest 3: 3 + 3, 3 + 2 + 1, 3 + 1 + 1 + 1.
Largest 2: 2 + 2 + 2, 2 + 2 + 1 + 1, 2 + 1 + 1 + 1 + 1.
Largest 1: six ones.
That is 11, matching p(6). Once the largest part is k, the rest is a partition of n − k with no part above k, so every group is a smaller problem of the same kind.
What is a Ferrers diagram, and what is a conjugate partition?
A Ferrers diagram draws a partition as left-aligned rows of dots, one row per part, longest on top; it is named after Norman Macleod Ferrers, as the integer partition article records.
Read the dots of 5 + 4 + 1 by columns instead of rows and you get 3 + 2 + 2 + 2 + 1, another partition of 10. This flip across the diagonal is the conjugate. A partition equal to its own conjugate, such as 2 + 2, is self-conjugate.
The flip proves a useful fact: partitions of n into exactly k parts are as many as partitions of n with largest part k, because the number of rows becomes the length of the top row.
Why do partitions into distinct parts equal partitions into odd parts?
Take n = 7. The partitions with all parts different are 7, 6 + 1, 5 + 2, 4 + 3 and 4 + 2 + 1. The partitions with only odd parts are 7, 5 + 1 + 1, 3 + 3 + 1, 3 + 1 + 1 + 1 + 1 and seven ones. Five each. For every n the two counts are equal; the integer partition article dates Euler's proof to 1748.
You can see why with a matching, as in our guide to counting with a bijection. Start from an odd partition and keep merging two equal parts until no two are equal:
5 + 1 + 1 becomes 5 + 2.
3 + 3 + 1 becomes 6 + 1.
3 + 1 + 1 + 1 + 1 becomes 3 + 2 + 2, then 4 + 3.
Seven ones become 2 + 2 + 2 + 1, then 4 + 2 + 1.
To go back, halve every even part until all parts are odd: 6 + 1 becomes 3 + 3 + 1. The match is exact because every whole number is an odd number times a power of 2 in exactly one way, the same reason binary is unique.
That congruence is stated in the integer partition article. Ramanujan's later work is the subject of our piece on his last letter and the mock theta functions.
How should you practise partition problems?
Decide whether order matters. If it does, it is not a partition.
Name the restriction: distinct parts, odd parts, at most k parts, or largest part k.
List small cases by largest part.
Draw the Ferrers diagram; conjugating turns a limit on the number of parts into a limit on the largest part.
Check small counts against the OEIS list before trusting a pattern.
If you keep mixing up ordered and unordered counting, the Fermi Problem Library has worked problems with a step-by-step solver that explains the reasoning rather than printing an answer. For olympiad counting, try our four-week combinatorics plan.



