Partitions of Integers
How many ways can 10 identical coins be split into stacks, ignoring the order of the stacks? This is the question of partitioning an integer. It turns out to be one of the most stubbornly beautiful problems in enumerative combinatorics. Unlike compositions (ordered sums), partitions have no closed elementary formula. For compositions, a simple stars-and-bars count from Combinations with Repetition settles everything. The number of partitions of grows in a way that resisted a clean description for over a century. Hardy and Ramanujan eventually found its asymptotic shape. The subject matters because partitions sit at a crossroads. They are combinatorial objects, drawn as Ferrers diagrams. They are also number-theoretic objects, governed by generating functions built from infinite products. And they are analytic objects, whose growth rate connects to modular forms. The single richest tool for taming them is the generating function. This is a direct descendant of the Ordinary Generating Functions machinery. Here, though, it is pushed into infinite products. This differs from the finite rational functions typical of simpler counting problems. The big picture is simple to state. A partition-counting question — how many partitions of have only odd parts? only distinct parts? at most parts? — nearly always translates into a manipulation. That manipulation involves an infinite product or its variants. Many identities look like deep coincidences. One example is Euler's theorem: partitions into odd parts and partitions into distinct parts are equinumerous. Such identities become one-line algebraic facts about these products. They are provable rigorously, without any hidden combinatorial gymnastics. This article builds the theory from the definition of a partition and its Ferrers diagram. It develops the generating function calculus. It proves Euler's odd/distinct theorem in full rigor via a bijection. It closes with the machinery's reach into modern combinatorics. This includes the doorway it opens to The Twelvefold Way, the unifying classification of counting problems about distributing objects into boxes.
- A partition of is a multiset of positive integers ("parts") summing to ; order does not matter.
- Ferrers (Young) diagrams turn partitions into rows of dots, making structural bijections visible.
- The generating function for , the number of partitions of , is the infinite product .
- Restricting part sizes or multiplicities corresponds exactly to restricting factors in the product.
- Euler's theorem: partitions into odd parts partitions into distinct parts, in equal number for every .
- Key idea: encoding a whole family of counting problems as one formal power series turns hard combinatorics into product/series algebra.
Where this lives today
Partition theory is not a museum piece; its generating-function calculus recurs across mathematics and its applications. In number theory, congruences of modulo small primes (Ramanujan's congruences , etc.) connect partitions to modular forms and the theory of -series. In representation theory and algebra, partitions index the irreducible representations of the symmetric group and the conjugacy classes of simultaneously, via Young diagrams, linking directly to the classification ideas that culminate in The Twelvefold Way. In statistical mechanics and physics, partition generating functions appear as partition functions (not coincidentally named) for bosonic systems, since occupation numbers of energy levels behave exactly like unrestricted part multiplicities. In computer science, partition-counting recurrences underlie algorithms for integer partition enumeration used in combinatorial optimization, cryptographic parameter counting, and in analyzing recursive data structures. In probability and statistics, random partitions (e.g. under the Plancherel measure) model random growth processes and connect to the Robinson–Schensted–Knuth correspondence, an advanced extension of the same Ferrers-diagram combinatorics introduced here.
Ask the tutor: Can you show me how to derive Euler's pentagonal number theorem and use it to build a fast recurrence for ?
A partition of a positive integer is a finite non-increasing sequence of positive integers
such that . Each is called a part, and is the number of parts. Two sequences that differ only in the order of their terms represent the same partition (a partition is really an unordered multiset of positive integers with a given sum, written in canonical non-increasing order for convenience). The number of partitions of is denoted , with the convention (the empty partition, with zero parts, is the unique partition of ). More generally, for a set of allowed part sizes, denotes the number of partitions of using only parts from ; if repetition of a part is restricted (e.g. parts must be distinct, or each part size used at most times), this is stated explicitly as a variant, e.g. for partitions of into distinct parts. A Ferrers diagram (equivalently, Young diagram) of is an array of left-justified rows of dots (or unit boxes), with row containing dots, rows stacked top to bottom in non-increasing length. The conjugate partition is obtained by reading the diagram's columns as rows, i.e. .
Intuition
A partition of answers "in how many essentially different ways can identical objects be grouped into piles?" Because piles have no names or order, gives (including itself as a single pile). Contrast this with compositions of , which count ordered sequences of positive parts summing to ; there are of those, since between each pair of the unit gaps we choose whether to cut. Partitions are the "unordered" cousin, and losing the order is exactly why no simple binomial-coefficient formula survives — the symmetry group acting on parts has size depending on how many parts repeat, and this varies wildly from partition to partition. The Ferrers diagram makes this structure visual, and reveals hidden symmetries instantly. Flipping a diagram across its main diagonal swaps rows and columns, turning a partition into its conjugate ; this single geometric operation proves, with no further work, that the number of partitions of into at most parts equals the number of partitions of with largest part at most — a fact that would be painful to verify by brute enumeration for large . Generating functions give an entirely different, algebraic, mental picture. Think of building a partition by deciding, for each possible part size , how many times appears. The choices are independent across different values of , so the generating function factors as an infinite product, one factor per part size, each factor itself an ordinary generating function (from Ordinary Generating Functions) for "how many copies of to include."
Let be any set of allowed part sizes, and let denote the number of partitions of using parts only from (with unlimited repetition of each allowed part, and ). Then, as formal power series in ,
In particular, taking , the ordinary generating function for is
We work in the ring of formal power series , where an infinite product is well-defined as a formal power series provided that for every fixed exponent , only finitely many factors contribute a nonzero coefficient to — a mild convergence condition automatically satisfied here since the factor contributes nothing below degree , so only the factors with affect the coefficient of . Hence the infinite product is really, for each fixed , a finite product computation, and the identity should be read coefficientwise.
Step 1: Expand each factor. For each , geometric series in the formal power series ring gives
where is a formal placeholder we interpret as "the number of times part is used." This is a valid formal power series identity because , checked by multiplying out and observing all terms telescope except the constant term .
Step 2: Multiply the factors and interpret the product. By definition of the product of formal power series,
where the sum on the right ranges over all functions from to that are eventually zero (equivalently, finitely supported, i.e. for all but finitely many ) — this finiteness is forced because we are forming a formal power series, and any nonzero coefficient of can only receive contributions from choices with , hence only finitely many can be nonzero in any single contributing term. This finite-support condition is precisely what makes the infinite product converge formally, matching Step 1's factor-by-factor validity.
Step 3: Identify the coefficient of . By Step 2, the coefficient of in equals the number of finitely-supported functions with .
Step 4: Bijection with partitions. There is a bijection between such functions and partitions of into parts from : given , form the partition consisting of copies of the part for each with , arranged in non-increasing order; conversely, given a partition of into parts from , let be the number of times occurs as a part. These two maps are mutually inverse (both simply record "multiplicity of each part size"), so they establish a bijection between the finitely-supported solutions of and partitions of using parts from .
Conclusion. Combining Steps 3 and 4, the coefficient of in equals exactly , the number of partitions of with parts in , for every . Since two formal power series with equal coefficients at every degree are equal, this proves
Taking gives the stated formula for .
∎Let denote the number of partitions of into distinct parts (each part size used at most once), with . Then
The proof mirrors the previous theorem, but each part size may now be used or times only, so its individual generating function is (choose "not included," contributing , or "included once," contributing ) rather than the full geometric series . Exactly as in Step 2 above, multiplying these factors over all and extracting the coefficient of counts finitely-supported choice functions with , which biject with partitions of into distinct parts (namely the parts with ) by the identical multiplicity-recording argument.
∎For every , the number of partitions of into parts that are all odd equals the number of partitions of into parts that are all distinct.
We give two independent proofs: an algebraic one via generating functions (in the spirit of the results above), and an explicit bijective one, since the theorem is a flagship example of both techniques working in harmony.
Proof 1 (generating functions). Let . By the first theorem applied with , the generating function for partitions into odd parts is
By the lemma, the generating function for partitions into distinct parts is
We show as formal power series. First factor each term using the algebraic identity (valid since in any commutative ring, in particular ). Hence
Consider the truncated product . Split the denominator's index set into odd and even indices:
Therefore
The factors appearing in the denominator cancel against the matching initial segment of in the numerator, leaving
As formal power series, we take coefficientwise: fix any degree . Once is large enough that , every factor in the remaining numerator product contributes only terms of degree beyond the constant term , so this numerator product is . Hence, modulo ,
and letting (all sufficiently large odd also become irrelevant mod ) gives . Since was arbitrary, every coefficient of equals the corresponding coefficient of , i.e. as formal power series. By the theorem and lemma above, the coefficients of and are exactly and (the odd-part count) respectively, so these two counting functions agree for every .
Proof 2 (explicit bijection, Glaisher's map). Given a partition of into odd parts, write each distinct odd value occurring with multiplicity using its binary expansion (distinct powers of , guaranteed uniquely by binary representation). Replace the copies of by the parts . These new parts sum to , so the total sum is preserved. All resulting parts across all distinct odd are pairwise distinct: two parts and (for odd or ) coincide only if and by uniqueness of factoring an integer into an odd part times a power of (every positive integer factors uniquely as with odd, ). Hence this map sends a partition into odd parts to a partition into distinct parts. Conversely, given a partition into distinct parts, write each part uniquely as with odd (existence and uniqueness of this factorization is the standard fact that every positive integer has a unique odd part after removing all factors of ). Group parts of by their odd component , and for each such , if the powers of two occurring are (necessarily distinct since the are themselves distinct for fixed ), replace this group by copies of the odd part . This produces a partition into odd parts summing to the same . These two constructions are mutually inverse: starting from an odd-parts partition, splitting each multiplicity into binary powers and then regrouping by odd value exactly reconstructs the original multiplicities, since binary representation is unique; starting from a distinct-parts partition, factoring out odd cores and regrouping, then re-splitting via binary expansion of the resulting multiplicity, recovers the original distinct parts, again by uniqueness of binary representation. Hence Glaisher's map is a bijection between partitions of into odd parts and partitions of into distinct parts, for every , proving the theorem constructively.
∎Worked examples
Example 1: partitions of into parts of size at most , computed two ways. By the Euler generating function theorem with ,
We extract the coefficient of directly via convolution rather than trusting a memorized formula. Write and ; multiplying these two gives where . Then multiplying by gives the coefficient of as
since each unit of "leftover" degree is absorbed by choosing parts equal to . Compute for by listing with :
- : →
- : none →
- : →
- : →
- : →
- : →
- : →
- : →
- : →
Sum: . So .
Cross-check by direct enumeration. Partitions of with all parts : , , , , , , , , , . That is partitions, matching the generating-function computation exactly.
Example 2: verifying Euler's odd–distinct theorem at , including the explicit Glaisher bijection on one instance. First enumerate partitions of into distinct parts (parts pairwise different): ; ; ; ; ; ; ; ; ; ; ; ; ; ; . Counting these, we get partitions (one should check no duplicates and no omissions: distinct-part partitions of are classically known to number ). Now enumerate partitions of into odd parts: ; ; ; ; ; ; ; ; ; ; ; ; ; ; . That is partitions. Both counts equal , matching the theorem, i.e. and the odd-part count is also . Now trace Glaisher's map on the odd-part partition of . Group by distinct odd value: value has multiplicity , contributing part . Value has multiplicity , contributing part . Value has multiplicity , contributing part . The image is the distinct-parts partition , which sums to as required, and indeed appears in our list of distinct-part partitions above. Running the inverse map on : factor (odd core , power ), (odd core , power ), (odd core , power ); regrouping by odd core gives multiplicity for value (from exponent , i.e. copies) and multiplicity for values and , exactly recovering .
The theorem crucially assumes each allowed part size may be repeated any number of times. If instead we cap the number of times a part may be used — say, part size may be used at most once for every — the correct generating function is as in the distinct-parts lemma, not . Concretely, take with the unrestricted theorem's formula:
so the (correct, unrestricted) theorem predicts : indeed . But if we impose the extra restriction "each part used at most once" without changing which generating function we use, we would wrongly also claim partitions of using distinct parts from ; the truth is there is only one: (since repeats the part three times, which is disallowed once repetition is capped). The correct generating function under this restriction is , whose coefficient of is , matching direct enumeration — not . This shows that silently reusing the unrestricted-repetition generating function once the "unlimited repetition" hypothesis has been dropped produces a numerically wrong answer, confirming that hypothesis is load-bearing rather than decorative.
Scope, edge cases & common traps
| Situation | What to use | Common mistake |
|---|---|---|
| Parts from , unlimited repeats | Applying this when repeats are actually capped | |
| Parts from , each used time | Confusing with the unrestricted product above | |
| Parts from , each used times | Forgetting to truncate the geometric series | |
| Exactly parts (not "at most") | Coefficient extraction needs the conjugate/Ferrers argument, not a bare product | Assuming a simple product tracks part-count directly |
| Defined as (empty partition) | Treating , which breaks the generating function's constant term |
The mathematician behind it
Origins · 1 minLeonhard Euler and how this was discovered
Euler initiated the systematic study of integer partitions in the 1740s while investigating problems posed by Philipp Naudé about representing numbers as sums. He was the first to realize that the generating function could serve as a bookkeeping device for partition counts, effectively inventing the formal power series method for combinatorial enumeration used throughout this article. His pentagonal number theorem, giving the sparse expansion of , remains one of the most striking identities in the field and underlies efficient recursive computation of .
Why doesn't a simple closed formula like exist for , unlike compositions?
Compositions of into ordered positive parts correspond to choosing which of the gaps between unit dots become "cuts," a direct stars-and-bars argument from Combinations with Repetition, giving the clean formula . Partitions quotient this count by the symmetric group action that permutes parts, but different partitions have different-sized "orbits" (a partition with all distinct parts has orbit size , while one with many repeated parts has a much smaller orbit, by Burnside-type reasoning). Because this orbit size varies unpredictably with the partition's shape, no uniform formula analogous to dividing by survives; the best available exact tool is the generating function product, and the best explicit formula is Hardy–Ramanujan's asymptotic expansion, not an exact closed form.
Is the generating function identity valid as a statement about convergent real-number series, or only formally?
Both, though the article treats it formally to sidestep convergence subtleties. For , each factor converges absolutely, and one can show the infinite product converges to an analytic function on the open unit disk whose Taylor coefficients are exactly ; this requires an analytic convergence argument beyond the purely algebraic coefficient-matching given in the proof here. The formal power series viewpoint is preferred pedagogically because it makes no reference to convergence at all: equality of formal power series is just equality of every coefficient, which is exactly what the coefficient-extraction proof establishes, with no analysis required.
How does the Ferrers diagram conjugation trick generalize beyond the "largest part vs. number of parts" fact?
Conjugation is an involution () on the set of all partitions of , so it pairs up partitions and can be used to prove many "partitions with property X = partitions with property Y" theorems whenever X and Y are dual under transposition. For instance, partitions of with parts at most correspond under conjugation to partitions of with at most parts, and self-conjugate partitions () biject with partitions into distinct odd parts — a companion identity to Euler's theorem, provable by examining the "hook" structure of the diagonal in a self-conjugate diagram.
What is the relationship between partitions of and partitions of a set, as discussed in The Twelvefold Way?
They are different objects despite the shared name. An integer partition breaks the number into a multiset of positive integer parts; a set partition breaks an -element set into nonempty, unordered, disjoint blocks. However, they are linked: the shape (multiset of block sizes) of a set partition is exactly an integer partition of , and this shape statistic is one of the twelve fundamental counting problems organized in The Twelvefold Way, where "distributing distinguishable or indistinguishable balls into distinguishable or indistinguishable boxes" is classified systematically, with integer partitions appearing as the answer to the "indistinguishable balls, indistinguishable boxes" case.
Why does Euler's pentagonal number theorem matter if this article only proves the basic generating function theorem?
The pentagonal number theorem gives the reciprocal expansion (sum over all integers , giving a sparse series with mostly zero coefficients). Multiplying this sparse series by must give , since by definition of as the reciprocal product; matching coefficients yields a recurrence expressing in terms of earlier values at pentagonal-number offsets. This recurrence, not the raw infinite product, is how is efficiently computed by hand or by early computers, and it is the natural next tool built on top of the generating function established in this article's central theorem.
Does the theorem's proof require assuming is a "small" number, the way a convergent product argument would?
No. The entire proof is carried out inside the formal power series ring , where is a formal symbol, not a number subject to convergence constraints. The only analytic-looking step — "for fixed degree , all sufficiently large-index factors are eventually irrelevant modulo " — is really a statement about polynomial truncation, not about numerical convergence, and it holds unconditionally for every formal power series ring regardless of what value (if any) is later substituted with.