21.16.01 · number-theory / partitions-circle-method

The Partition Function, Generating Functions, and the Pentagonal Number Theorem

shipped3 tiersLean: none

Anchor (Master): Apostol 1976 *Introduction to Analytic Number Theory* Ch. 14 (Euler products, the pentagonal number theorem, Jacobi triple product, Ramanujan congruences stated); Andrews 1976 *The Theory of Partitions* Ch. 1-2, 10 (Franklin's involution, the Jacobi triple product, Rogers-Ramanujan); Hardy-Wright 2008 *An Introduction to the Theory of Numbers* 6e (Oxford) Ch. XIX; Euler 1748 *Introductio in analysin infinitorum* Ch. XVI (originator of the generating function and the pentagonal recurrence); Jacobi 1829 *Fundamenta Nova* (the triple product); Hardy-Ramanujan 1918 *Proc. London Math. Soc.* (2) 17 (the asymptotic $p(n) \sim e^{\pi\sqrt{2n/3}}/(4n\sqrt 3)$, prelude to the circle method)

Intuition Beginner

How many ways can you break a whole number into a sum of positive whole numbers, if the order of the pieces does not matter? The number can be written as , as , as , as , and as : five ways. Each of these is called a partition of , and the count of them is written . The function that records this count for every is the partition function, and it grows astonishingly fast — is already more than million.

Counting partitions one number at a time is hopeless by hand for large , so we pack every count into one bookkeeping device: an infinite product. Imagine a separate "stall" for each part size. The stall for the part offers you any number of copies of ; the stall for offers any number of copies of ; and so on. Multiplying out all the stalls and collecting the term for reproduces exactly the partitions of . This product is the generating function for , and it turns a counting question into algebra.

The surprise of this unit is a near-magical cancellation. When you multiply out the closely related product where each stall offers a part at most once with a plus-or-minus sign, almost everything cancels, and what survives sits only at a thin sequence of special exponents — the pentagonal numbers . This is Euler's pentagonal number theorem, and it hands you a fast recurrence that computes from earlier values.

Visual Beginner

A partition is drawn as a Ferrers diagram: rows of dots, one row per part, longest at the top. The partition is three rows of lengths . Flipping the diagram across its diagonal — turning rows into columns — produces another partition, the conjugate, and this single picture proves several counting identities at once.

The pentagonal numbers on the right are the exponents as runs through , giving . Euler's theorem says the product has non-zero coefficients only at these exponents, each equal to or .

Worked example Beginner

Compute in two ways: by listing, then by Euler's recurrence.

Step 1. List the partitions of . They are ; ; ; ; ; ; and . Counting gives seven, so .

Step 2. Now use Euler's recurrence, which reads where the shifts are the pentagonal numbers, the signs come in the repeating pattern plus, plus, minus, minus, and any term with a negative argument is dropped. We treat and .

Step 3. Apply it at . The available shifts are (since ): . This matches the direct list.

Step 4. Push one step further. At : , again matching the table.

What this tells us: the recurrence computes a count that would otherwise require exhaustively listing partitions, using only a handful of earlier values and the sparse pentagonal shifts. The hard combinatorial object is governed by a simple algebraic identity.

Check your understanding Beginner

Formal definition Intermediate+

Throughout, is a formal variable, or a complex number with when convergence is needed; all infinite products below converge absolutely there.

Definition (partition). A partition of a positive integer is a non-increasing sequence of positive integers with . The are the parts. The partition function is the number of partitions of , with the conventions (the empty partition) and for .

Definition (generating function). The generating function of is the formal power series . Following Euler [Euler 1748], it has the product representation $$ \sum_{n=0}^{\infty} p(n) q^n ;=; \prod_{k=1}^{\infty} \frac{1}{1 - q^k} ;=; \prod_{k=1}^{\infty}\big(1 + q^k + q^{2k} + q^{3k} + \cdots\big), $$ where the -th factor records the number of copies of the part . Selecting the term from the -th factor and multiplying yields , so the coefficient of counts the solutions of in non-negative integers — exactly the partitions of .

Definition (restricted partitions). For a set , the generating function for partitions with all parts in is . For partitions into distinct parts (each used at most once), the generating function is . We write for the number of partitions of into odd parts and for the number into distinct parts.

Definition (pentagonal numbers). The generalised pentagonal numbers are the integers for ; as runs over they take the values . The notation is the Euler function, registered in _meta/NOTATION.md together with .

Counterexamples to common slips Intermediate+

  • " counts ordered sums (compositions)." It does not. The compositions of — ordered sums — number , whereas . Partitions identify with .

  • "Distinct parts is the same as odd parts as partitions." The two counts are equal (Euler), but the partitions themselves differ: for the distinct-part partitions are not the odd-part partitions . Glaisher's bijection is what matches them.

  • "The pentagonal number theorem has both signs at every pentagonal exponent." Each generalised pentagonal number arises from exactly one (the map is injective on ), so the coefficient at is the single sign , not a sum of two contributions.

  • " converges for all ." The product converges only for ; on it has the unit circle as a natural boundary, which is the analytic obstruction the circle method must navigate when extracting the asymptotics of .

Key theorem with proof Intermediate+

The signature theorem is Euler's pentagonal number theorem. Its force is that the reciprocal of the partition generating function — a product over all — collapses to a sparse signed sum supported on the pentagonal numbers, and this yields a linear recurrence computing .

Theorem (Euler's pentagonal number theorem). As an identity of formal power series, $$ \prod_{k=1}^{\infty}(1 - q^k) ;=; \sum_{k=-\infty}^{\infty} (-1)^k q^{k(3k-1)/2} ;=; 1 + \sum_{k=1}^{\infty}(-1)^k\Big(q^{k(3k-1)/2} + q^{k(3k+1)/2}\Big). $$

Proof (Franklin's involution). Expanding and collecting the coefficient of , a partition of into distinct parts contributes . Hence the coefficient of equals , where and count partitions of into an even, respectively odd, number of distinct parts. The theorem asserts unless , in which case it is .

To prove this we construct a sign-reversing involution on the set of partitions of into distinct parts, pairing each even-length partition with an odd-length one so that the two cancel. For a partition into distinct parts, let be the smallest part , and let be the length of the top staircase: the largest such that are consecutive integers .

Define two moves on the Ferrers diagram. Move A removes the smallest part and adds to each of the top parts (transferring the bottom row onto the staircase); it applies when . Move B subtracts from each of the top parts and creates a new smallest part of size ; it applies when . Each move changes the number of parts by exactly one, so it reverses the sign , and the two moves are mutually inverse, giving an involution wherever both are defined.

The involution fails to be defined exactly when the two regions overlap or collide. This happens precisely when the staircase reaches down to the smallest part, i.e. when with (giving ), or when with and the moved cell would re-enter the staircase (giving ). In each exceptional case there is a single unpaired partition of length , contributing at . All other partitions cancel in pairs. Therefore if and otherwise [Andrews 1976].

Corollary (the recurrence for ). Since , equating coefficients of for and substituting the pentagonal expansion gives $$ p(n) ;=; \sum_{k \geq 1} (-1)^{k+1}\Big( p\big(n - g_k\big) + p\big(n - g_{-k}\big) \Big) ;=; p(n-1) + p(n-2) - p(n-5) - p(n-7) + \cdots, $$ the sum terminating once . This computes in additions per value.

Bridge. The pentagonal number theorem builds toward the analytic theory of the partition generating function: the same product (with ) is the Dedekind eta function, and the recurrence is the elementary shadow of its modularity, which appears again in 21.04.04 where theta and eta products are read as modular forms. The foundational reason the sparse identity exists is the Jacobi triple product, of which the pentagonal theorem is the specialisation , ; this is exactly the statement that a doubly-infinite theta sum factors as a product, and it generalises the elementary sieve of distinct-versus-odd parts into the full machinery of theta functions. Putting these together, the convolution identity is a Dirichlet-style inversion in the ring of formal power series, dual to the Möbius inversion of 21.11.01: there summing over divisors was inverted by ; here summing over partitions is inverted by the pentagonal signs. The bridge is that a hard counting function is pinned down by a sparse algebraic reciprocal, and that principle reappears in the circle-method asymptotics of Hardy and Ramanujan.

Exercises Intermediate+

Advanced results Master

The elementary recurrence is the entry to a deep analytic and arithmetic theory. We collect the structural results: the Jacobi triple product as the parent identity, the modular interpretation through the Dedekind eta function, the Hardy-Ramanujan asymptotic, the Ramanujan congruences, and the Rogers-Ramanujan identities.

Theorem 1 (Jacobi triple product). For formal variables with and , $$ \prod_{m=1}^{\infty}(1 - q^{2m})(1 + q^{2m-1}z)(1 + q^{2m-1}z^{-1}) ;=; \sum_{k=-\infty}^{\infty} q^{k^2} z^k. $$ Specialisation gives the theta series of 21.04.04; the substitution , of Exercise 6 gives Euler's pentagonal number theorem; gives . The triple product is the master identity from which the generating-function identities of this chapter descend [Andrews 1976].

Theorem 2 (modular interpretation; Dedekind eta). Setting with , the Euler function is , where is the Dedekind eta function, a modular form of weight transforming by and . Consequently the partition generating function is , a weakly holomorphic modular form of weight . The transformation law under , dual to the theta inversion of 21.04.04, is precisely what powers the circle-method asymptotics: the dominant singularity of as controls the growth of .

Theorem 3 (Hardy-Ramanujan asymptotic). The partition function satisfies [Hardy-Ramanujan 1918] $$ p(n) ;\sim; \frac{1}{4n\sqrt 3}, \exp!\Big(\pi \sqrt{\tfrac{2n}{3}}\Big) \qquad (n \to \infty). $$ The proof is the prototype of the circle method: write with , deform the contour to approach the unit circle, and sum the contributions of the rational points , where the modular transformation of gives the local behaviour. Rademacher 1937 refined the asymptotic to a convergent exact series , with a Kloosterman-type sum.

Theorem 4 (Ramanujan congruences). For all , $$ p(5n + 4) \equiv 0 \pmod 5, \qquad p(7n + 5) \equiv 0 \pmod 7, \qquad p(11n + 6) \equiv 0 \pmod{11}. $$ These are coefficient congruences for the modular form ; the -case follows from the identity , which exhibits the factor explicitly. Ramanujan's further conjectures on powers of were established by Watson and Atkin; Ono 2000 and Ahlgren-Ono proved that for every prime there exist infinitely many congruences , while Ahlgren-Boylan showed are the only primes admitting a congruence of the simplest Ramanujan shape.

Theorem 5 (Rogers-Ramanujan identities). The two identities $$ \sum_{k=0}^{\infty}\frac{q^{k^2}}{(q;q)k} = \prod{m \geq 0}\frac{1}{(1 - q^{5m+1})(1 - q^{5m+4})}, \quad \sum_{k=0}^{\infty}\frac{q^{k^2 + k}}{(q;q)k} = \prod{m \geq 0}\frac{1}{(1 - q^{5m+2})(1 - q^{5m+3})}, $$ where , equate a sum side (partitions with parts differing by at least ) with a product side (partitions into parts , resp. , modulo ). They lie beyond Euler's elementary methods and connect partition theory to the Andrews-Gordon hierarchy, affine Lie algebras (the Lepowsky-Wilson vertex-operator proof), and statistical mechanics (Baxter's hard-hexagon model).

Synthesis. Putting these together, the pentagonal number theorem is the foundational reason the elementary and analytic theories of partitions are one subject: the sparse signed reciprocal is exactly the Euler function , so the combinatorial recurrence and the circle-method asymptotic are two faces of the modularity of . The central insight is that a counting function with no closed form is nonetheless controlled at every scale — exactly, by the recurrence; asymptotically, by Hardy-Ramanujan; arithmetically, by the Ramanujan congruences — because its generating function is a modular form. This generalises the elementary distinct-equals-odd sieve into the Jacobi triple product, which is dual to the theta series of 21.04.04 and from which both the pentagonal identity and the sum-of-squares formulas descend by specialising the variable . Putting these together, the convolution inversion is the partition-theoretic analogue of Möbius inversion in 21.11.01, and the bridge is that modularity, not elementary combinatorics, is the organising structure: the circle method, the congruences, and Rogers-Ramanujan all read off properties of that the pentagonal theorem first made visible.

Full proof set Master

Proposition 1 (generating function identity). In , .

Proof. For each , as a formal power series. The partial product is a well-defined element of whose coefficient of counts solutions of in non-negative integers — partitions of into parts . For fixed , no partition of uses a part exceeding , so for the coefficient of stabilises at . Hence the infinite product converges in the -adic topology of to a series whose -coefficient is .

Proposition 2 (the recurrence is exact and finite). For , , i.e. , a sum of terms.

Proof. Multiply the identities and (Proposition 1 and the pentagonal theorem). Their product is , so $$ \Big(\sum_{n \geq 0} p(n) q^n\Big)\Big(\sum_{k \in \mathbb{Z}}(-1)^k q^{g_k}\Big) = 1. $$ The coefficient of on the left is . For this is ; for it must equal . Isolating the term (, sign ) gives , i.e. the stated recurrence. The number of non-zero terms is the number of with , which is since .

Proposition 3 (Jacobi triple product implies the pentagonal theorem). The substitution , in the triple product yields .

Proof. In , set , . The general term on the right is . On the left: ; ; . As ranges over , the exponents enumerate without repetition, so the product is . Equality of the two sides is the pentagonal number theorem.

Proposition 4 (distinct-equals-odd and Glaisher, generating-function form). For each , .

Proof. The finite geometric sum gives , so the left side is . Write and note . The numerator cancels the factor of the denominator, leaving , the generating function for partitions with no part divisible by . The left side generates partitions with each part repeated at most times, so the two counts agree. The case is Euler's distinct-equals-odd theorem.

Connections Master

  • The pentagonal recurrence is a convolution inversion in the ring of formal power series, the partition-theoretic analogue of the Möbius inversion of 21.11.01: there the unit function is inverted by under Dirichlet convolution; here the partition generating function is inverted by the pentagonal signs under Cauchy convolution. Both are instances of inverting a series with constant term .

  • The Jacobi triple product specialises at to the theta series of 21.04.04; the pentagonal product and the sum-of-squares formulas are sibling specialisations of the same identity, and the modularity of used for partition asymptotics is dual to the theta inversion proved there by Poisson summation.

  • The convergence and natural-boundary behaviour of on rests on the absolute-convergence criteria of 02.03.03; the -adic stabilisation argument of Proposition 1 and the circle-method contour deformation both depend on controlling the infinite product near the unit circle, where the series of 02.03.03 governs the tail estimates.

  • The generating-function bookkeeping that turns a part of size into a geometric factor is the same Euler-product mechanism that converts multiplicativity into factors in 21.04.04; partitions are the additive analogue of the multiplicative Euler product, with addition of parts replacing multiplication of prime powers.

Historical & philosophical context Master

The systematic theory of partitions begins with Euler's 1748 Introductio [Euler 1748], where the generating-function product first appears and where Euler states the pentagonal number theorem. Euler discovered the theorem empirically — multiplying out to high order and noticing that the surviving terms sat only at the pentagonal exponents — and corresponded about it with Goldbach for years before producing a proof around 1750. The combinatorial proof by sign-reversing involution was supplied much later by Fabian Franklin in 1881 (Comptes Rendus 92), giving the bijective argument reproduced above and making the cancellation transparent rather than analytic.

Jacobi's 1829 Fundamenta Nova [Jacobi 1829] subsumed Euler's identity into the triple product, situating partition identities within the theory of elliptic and theta functions and revealing the pentagonal theorem as one specialisation among many. The analytic high point came with Hardy and Ramanujan's 1918 paper [Hardy-Ramanujan 1918], which determined the asymptotic growth of by the circle method — the contour-integral technique that extracts coefficient asymptotics from the singularities of a modular generating function — and which Rademacher later sharpened into a convergent exact formula. Ramanujan's congruences modulo , announced in 1919, opened the arithmetic theory of , completed in the modern era by Atkin, Watson, and the modular-forms methods of Ono and Ahlgren that produced congruences for every prime modulus .

Bibliography Master

@book{euler1748introductio,
  author    = {Euler, Leonhard},
  title     = {Introductio in analysin infinitorum},
  volume    = {1},
  publisher = {Marcum-Michaelem Bousquet},
  address   = {Lausanne},
  year      = {1748},
  note      = {Chapter XVI: De partitione numerorum}
}

@article{franklin1881pentagonal,
  author  = {Franklin, Fabian},
  title   = {Sur le d\'{e}veloppement du produit infini $(1-x)(1-x^2)(1-x^3)\cdots$},
  journal = {Comptes Rendus de l'Acad\'{e}mie des Sciences (Paris)},
  volume  = {92},
  pages   = {448--450},
  year    = {1881}
}

@book{jacobi1829fundamenta,
  author    = {Jacobi, Carl Gustav Jacob},
  title     = {Fundamenta Nova Theoriae Functionum Ellipticarum},
  publisher = {Borntr\"{a}ger},
  address   = {K\"{o}nigsberg},
  year      = {1829}
}

@article{hardyramanujan1918,
  author  = {Hardy, G. H. and Ramanujan, S.},
  title   = {Asymptotic formulae in combinatory analysis},
  journal = {Proceedings of the London Mathematical Society (2)},
  volume  = {17},
  pages   = {75--115},
  year    = {1918}
}

@book{andrews1976partitions,
  author    = {Andrews, George E.},
  title     = {The Theory of Partitions},
  series    = {Encyclopedia of Mathematics and its Applications},
  volume    = {2},
  publisher = {Addison-Wesley},
  year      = {1976}
}

@article{rademacher1937convergent,
  author  = {Rademacher, Hans},
  title   = {On the partition function $p(n)$},
  journal = {Proceedings of the London Mathematical Society (2)},
  volume  = {43},
  pages   = {241--254},
  year    = {1937}
}

@article{ahlgrenono2001congruences,
  author  = {Ahlgren, Scott and Ono, Ken},
  title   = {Congruence properties for the partition function},
  journal = {Proceedings of the National Academy of Sciences},
  volume  = {98},
  number  = {23},
  pages   = {12882--12884},
  year    = {2001}
}