Pentagonal number theorem

In mathematics, Euler's pentagonal number theorem relates the product and series representations of the Euler function. It states that


 * $$\prod_{n=1}^{\infty}\left(1-x^{n}\right)=\sum_{k=-\infty}^{\infty}\left(-1\right)^{k}x^{k\left(3k-1\right)/2}=1+\sum_{k=1}^\infty(-1)^k\left(x^{k(3k+1)/2}+x^{k(3k-1)/2}\right).$$

In other words,


 * $$(1-x)(1-x^2)(1-x^3) \cdots = 1 - x - x^2 + x^5 + x^7 - x^{12} - x^{15} + x^{22} + x^{26} - \cdots.$$

The exponents 1, 2, 5, 7, 12, ... on the right hand side are given by the formula $g_{k} = k(3k − 1)/2$ for k = 1, −1, 2, −2, 3, ... and are called (generalized) pentagonal numbers. (The constant term 1 corresponds to $$k=0$$.) This holds as an identity of convergent power series for $$|x|<1$$, and also as an identity of formal power series.

A striking feature of this formula is the amount of cancellation in the expansion of the product.

Relation with partitions
The identity implies a recurrence for calculating $$p(n)$$, the number of partitions of n:


 * $$p(n)=p(n-1)+p(n-2)-p(n-5)-p(n-7)+\cdots$$

or more formally,


 * $$p(n)=\sum_{k\neq 0} (-1)^{k-1}p(n-g_k)$$

where the summation is over all nonzero integers k (positive and negative) and $$g_k $$ is the kth generalized pentagonal number. Since $$p(n)=0$$ for all $$n<0$$, the apparently infinite series on the right has only finitely many non-zero terms, enabling an efficient calculation of p(n).

Franklin's bijective proof
The theorem can be interpreted combinatorially in terms of partitions. In particular, the left hand side is a generating function for the number of partitions of n into an even number of distinct parts minus the number of partitions of n into an odd number of distinct parts. Each partition of n into an even number of distinct parts contributes +1 to the coefficient of xn; each partition into an odd number of distinct parts contributes &minus;1. (The article on unrestricted partition functions discusses this type of generating function.)

For example, the coefficient of x5 is +1 because there are two ways to split 5 into an even number of distinct parts (4 + 1 and 3 + 2), but only one way to do so for an odd number of distinct parts (the one-part partition 5). However, the coefficient of x12 is −1 because there are seven ways to partition 12 into an even number of distinct parts, but there are eight ways to partition 12 into an odd number of distinct parts, and 7 − 8 = −1.

This interpretation leads to a proof of the identity by canceling pairs of matched terms (involution method). Consider the Ferrers diagram of any partition of n into distinct parts. For example, the diagram below shows n = 20 and the partition 20 = 7 + 6 + 4 + 3.


 * [[Image:GrayDot.svg|16px|*]][[Image:GrayDot.svg|16px|*]][[Image:GrayDot.svg|16px|*]][[Image:GrayDot.svg|16px|*]][[Image:GrayDot.svg|16px|*]][[Image:GrayDot.svg|16px|*]][[Image:RedDot.svg|16px|o]] [[Image:GrayDot.svg|16px|*]][[Image:GrayDot.svg|16px|*]][[Image:GrayDot.svg|16px|*]][[Image:GrayDot.svg|16px|*]][[Image:GrayDot.svg|16px|*]][[Image:RedDot.svg|16px|o]] [[Image:GrayDot.svg|16px|*]][[Image:GrayDot.svg|16px|*]][[Image:GrayDot.svg|16px|*]][[Image:GrayDot.svg|16px|*]] [[Image:GrayDot.svg|16px|*]][[Image:GrayDot.svg|16px|*]][[Image:GrayDot.svg|16px|*]]

Let m be the number of elements in the smallest row of the diagram (m = 3 in the above example). Let s be the number of elements in the rightmost 45 degree line of the diagram (s = 2 dots in red above, since 7 &minus; 1 = 6, but 6 &minus; 1 > 4). If m > s, take the rightmost 45-degree line and move it to form a new row, as in the matching diagram below.


 * [[Image:GrayDot.svg|16px|*]][[Image:GrayDot.svg|16px|*]][[Image:GrayDot.svg|16px|*]][[Image:GrayDot.svg|16px|*]][[Image:GrayDot.svg|16px|*]][[Image:GrayDot.svg|16px|*]] [[Image:GrayDot.svg|16px|*]][[Image:GrayDot.svg|16px|*]][[Image:GrayDot.svg|16px|*]][[Image:GrayDot.svg|16px|*]][[Image:GrayDot.svg|16px|*]] [[Image:GrayDot.svg|16px|*]][[Image:GrayDot.svg|16px|*]][[Image:GrayDot.svg|16px|*]][[Image:GrayDot.svg|16px|*]] [[Image:GrayDot.svg|16px|*]][[Image:GrayDot.svg|16px|*]][[Image:GrayDot.svg|16px|*]] [[Image:RedDot.svg|16px|o]][[Image:RedDot.svg|16px|o]]

If m ≤ s (as in our newly formed diagram where m = 2, s = 5) we may reverse the process by moving the bottom row to form a new 45 degree line (adding 1 element to each of the first m rows), taking us back to the first diagram.

A bit of thought shows that this process always changes the parity of the number of rows, and applying the process twice brings us back to the original diagram. This enables us to pair off Ferrers diagrams contributing 1 and &minus;1 to the xn term of the series, resulting in a net coefficient of 0 for xn. This holds for every term except when the process cannot be performed on every Ferrers diagram with n dots. There are two such cases:

1) m = s and the rightmost diagonal and bottom row meet. For example,


 * [[Image:GrayDot.svg|16px|*]][[Image:GrayDot.svg|16px|*]][[Image:GrayDot.svg|16px|*]][[Image:GrayDot.svg|16px|*]][[Image:GrayDot.svg|16px|*]] [[Image:GrayDot.svg|16px|*]][[Image:GrayDot.svg|16px|*]][[Image:GrayDot.svg|16px|*]][[Image:GrayDot.svg|16px|*]] [[Image:RedDot.svg|16px|*]][[Image:RedDot.svg|16px|*]][[Image:RedDot.svg|16px|*]]

Attempting to perform the operation would lead us to:


 * [[Image:GrayDot.svg|16px|*]][[Image:GrayDot.svg|16px|*]][[Image:GrayDot.svg|16px|*]][[Image:GrayDot.svg|16px|*]][[Image:GrayDot.svg|16px|*]][[Image:RedDot.svg|16px|*]] [[Image:GrayDot.svg|16px|*]][[Image:GrayDot.svg|16px|*]][[Image:GrayDot.svg|16px|*]][[Image:GrayDot.svg|16px|*]][[Image:RedDot.svg|16px|*]] [[Image:RedDot.svg|16px|*]]

which fails to change the parity of the number of rows, and is not reversible in the sense that performing the operation again does not take us back to the original diagram. If there are m elements in the last row of the original diagram, then


 * $$n=m+(m+1)+(m+2)+\cdots+(2m-1)=\frac {m(3m-1)}{2}=\frac {k(3k-1)}{2}$$

where the new index k is taken to equal m. Note that the sign associated with this partition is (−1)s, which by construction equals (−1)m and (−1)k.

2) m =  s + 1 and the rightmost diagonal and bottom row meet.  For example,


 * [[Image:GrayDot.svg|16px|*]][[Image:GrayDot.svg|16px|*]][[Image:GrayDot.svg|16px|*]][[Image:GrayDot.svg|16px|*]][[Image:GrayDot.svg|16px|*]][[Image:RedDot.svg|16px|*]] [[Image:GrayDot.svg|16px|*]][[Image:GrayDot.svg|16px|*]][[Image:GrayDot.svg|16px|*]][[Image:GrayDot.svg|16px|*]][[Image:RedDot.svg|16px|*]] [[Image:GrayDot.svg|16px|*]][[Image:GrayDot.svg|16px|*]][[Image:GrayDot.svg|16px|*]][[Image:RedDot.svg|16px|*]]

Our operation requires us to move the right diagonal to the bottom row, but that would lead to two rows of three elements, forbidden since we're counting partitions into distinct parts. This is the previous case but with one fewer row, so


 * $$n=m+(m+1)+(m+2)+\cdots+(2m-2)=\frac{(m-1)(3m-2)}{2}=\frac{k(3k-1)}{2},$$

where we take k = 1&minus;m (a negative integer). Here the associated sign is (&minus;1)s with s = m &minus; 1 = −k, therefore the sign is again (−1)k.

In summary, it has been shown that partitions into an even number of distinct parts and an odd number of distinct parts exactly cancel each other, producing null terms 0xn, except if n is a generalized pentagonal number $$n = g_k = k(3k-1)/2$$, in which case there is exactly one Ferrers diagram left over, producing a term (−1)kxn. But this is precisely what the right side of the identity says should happen, so we are finished.

Partition recurrence
We can rephrase the above proof, using integer partitions, which we denote as: $$n = \lambda_1 + \lambda_2 + \cdots + \lambda_\ell$$, where $$\lambda_1\geq \lambda_2\geq\ldots\geq\lambda_\ell > 0$$. The number of partitions of n is the partition function p(n) having generating function:


 * $$\sum_{n=0}^\infty p(n) x^n = \prod_{k=1}^\infty (1 - x^k)^{-1}$$

Note that is the reciprocal of the product on the left hand side of our identity:


 * $$ \left( \sum_{n=0}^\infty p(n) x^n \right) \cdot \left(\prod_{n=1}^\infty (1-x^n)\right)

= 1 $$

Let us denote the expansion of our product by $$ \prod_{n=1}^\infty (1-x^n) = \sum_{n=0}^\infty a_nx^n,$$ so that


 * $$ \left( \sum_{n=0}^\infty p(n) x^n \right) \cdot \left(\sum_{n=0}^\infty a_nx^n\right) = 1. $$

Multiplying out the left hand side and equating coefficients on the two sides, we obtain a0 p(0) = 1 and $$\sum_{i=0}^n p(n-i) a_i = 0$$ for all $$n\geq 1$$. This gives a recurrence relation defining p(n) in terms of an, and vice versa a recurrence for an in terms of p(n). Thus, our desired result:


 * $$a_i := \begin{cases}1 & \text{ if } i = \frac{1}{2}(3k^2 \pm k) \text{ and } k \text{ is even}\\

-1 & \text{ if } i = \frac{1}{2}(3k^2 \pm k) \text{ and } k \text{ is odd }\\ 0 & \text{ otherwise }\end{cases}$$

for $$i\geq 1$$ is equivalent to the identity $$\sum_i (-1)^i p(n-g_i) = 0,$$ where $$g_i := \textstyle\frac{1}{2}(3i^2-i)$$ and i ranges over all integers such that $$g_i \leq n$$ (this range includes both positive and negative i, so as to use both kinds of generalized pentagonal numbers). This in turn means:


 * $$\sum_{i \mathrm{\ even}} p(n-g_i) = \sum_{i \mathrm{\ odd}} p(n-g_i).$$

In terms of sets of partitions, this is equivalent to saying that the following sets are of equal cardinality:


 * $$\mathcal{X} := \bigcup_{i \mathrm{\ even}} \mathcal{P}(n-g_i)$$        and         $$\mathcal{Y} :=  \bigcup_{i \text{ odd}} \mathcal{P}(n-g_i),$$

where $$\mathcal{P}(n)$$ denotes the set of all partitions of $$n$$. All that remains is to give a bijection from one set to the other, which is accomplished by the function φ from X to Y which maps the partition $$\mathcal{P}(n-g_i) \ni \lambda : n-g_i = \lambda_1 + \lambda_2 + \dotsb + \lambda_\ell$$ to the partition $$\lambda' = \varphi(\lambda)$$ defined by:


 * $$ \varphi(\lambda) :=

\begin{cases} \lambda' : n - g_{i-1} = (\ell + 3i -2) + (\lambda_1 - 1) + \dotsb + (\lambda_\ell - 1) &\text{ if } \ell+3i > \lambda_1\\ \\ \lambda' : n - g_{i+1} = (\lambda_2 + 1) + \dotsb + (\lambda_\ell + 1) + \underbrace{1+\dotsb+1}_{\lambda_1 - \ell - 3i} &\text{ if } \ell+3i \leq \lambda_1. \end{cases} $$

This is an involution (a self-inverse mapping), and thus in particular a bijection, which proves our claim and the identity.