Unexpected Proofs Using Generating Functions I recently came across this beautiful proof by Erdős that uses generating functions in a unique way:

Let $S = \{a_1, \cdots, a_n \}$ be a finite set of positive integers such that no two subsets of $S$ have the same sum. Prove that $$\sum_{i=1}^n \frac{1}{a_i} < 2.$$

Question: Are there any more examples of surprising or unexpected proofs using generating functions that this community is aware of? 
(Please refrain from posting answers that are widely known such as change making, closed form for Fibonacci, etc.) 
The proof of the above theorem:
Proof:
Suppose $0< x < 1$. We have 
$$\prod_{i=1}^n (1 + x^{a_i}) < \sum_{i = 0}^{\infty} x^i = \frac{1}{1-x}.$$ Thus, 
$$\begin{align*}
\sum_{i=1}^n \log(1+x^{a_i}) &< - \log(1-x) \\
\sum_{i=1}^n \int_0^1 \frac{\log(1+x^{a_i})}{x} \ dx &< - \int_0^1 \frac{\log(1-x)}x \ dx .
\end{align*}$$
Putting $x^{a_i} = y$, we obtain 
$$\begin{align*}
\sum_{i=1}^{n} \frac{1}{a_i} \int_0^1 \frac{\log(1+y)}{y} \ dy < - \int_0^1 \frac{\log(1-x)}{x} \ dx 
\end{align*}$$ i.e.,
$$\sum_{i=1}^n \frac{1}{a_i} \left( \frac{\pi^2}{12} \right) < \frac{\pi^2}6.$$
Thus, $\sum_{i=1}^n \frac{1}{a_i} < 2$ and the theorem is proved. 


Sicherman dice are the only pair of 6-sided dice that are not normal dice, bear only positive integers, and have the same probability distribution for the sum as normal dice.
The faces on the dice are numbered 1, 2, 2, 3, 3, 4 and 1, 3, 4, 5, 6, 8. 
(Source: Wikipedia article on Sicherman dice)

We can prove this fact using generating functions. 
Let the non-standard dice $A$ and $B$ have faces $(a_1,a_2,a_3,a_4,a_5,a_6)$ and $(b_1,b_2,b_3,b_4,b_5,b_6)$. 
Let $a(x) = x^{a_1}+x^{a_2}+x^{a_3}+x^{a_4}+x^{a_5}+x^{a_6}$ and $b(x) = x^{b_1}+x^{b_2}+x^{b_3}+x^{b_4}+x^{b_5}+x^{b_6}$ be the generating functions for the number rolled on dice $A$ and dice $B$ respectively.
When the product $$a(x)b(x) = (x^{a_1}+x^{a_2}+x^{a_3}+x^{a_4}+x^{a_5}+x^{a_6})(x^{b_1}+x^{b_2}+x^{b_3}+x^{b_4}+x^{b_5}+x^{b_6})$$ is expanded as a polynomial, the $x^n$ coefficient is the number of ways these non-standard dice can have a sum of $n$. If the sum of the non-standard dice has the same distribution as two standard dice, then the above product must be equal to the product of the generating functions for two standard dice, i.e.
\begin{align}
a(x)b(x) &= (x+x^2+x^3+x^4+x^5+x^6)^2
\\
&= [x(1+x+x^2+x^3+x^4+x^5)]^2
\\
&= [x(1+x^3)(1+x+x^2)]^2
\\
&= [x(1+x)(1-x+x^2)(1+x+x^2)]^2.
\end{align}
We just need to figure out how to distribute the factors between the polynomials $a(x)$ and $b(x)$. 
Since each dice must have only positive integer faces, $x$ divides both $a(x)$ and $b(x)$. Hence, $a(x)$ and $b(x)$ must each get one of the two $x$ factors. 
Since dice $A$ and $B$ both have $6$ faces, $a(1) = b(1) = 6$. Notice that $(1+x)\left.\right|_{x = 1} = 2$, $(1-x+x^2)\left.\right|_{x = 1} = 1$, and $(1+x+x^2)\left.\right|_{x = 1} = 3$. Clearly, $a(x)$ and $b(x)$ must each get one of the two $1+x$ factors and one of the two $1+x+x^2$ factors. 
This leaves only the two $1-x+x^2$ factors. If we distribute one to each of $a(x)$ and $b(x)$, then we will have $a(x) = b(x)$, and we'll end up with the standard dice. Thus, we have to give both $1-x+x^2$ factors to the same dice generating function (WLOG $b(x)$). 
This gives us
\begin{align}
a(x) &= x(1+x)(1+x+x^2) 
\\
&= x+2x^2+2x^3+x^4
\\
\left.\right.
\\
b(x) &= x(1+x)(1+x+x^2)(1-x+x^2)^2
\\
&= x+x^3+x^4+x^5+x^6+x^8
\end{align}
Therefore, the only pair of 6-sided dice that are not normal dice, bear only positive integers, and have the same probability distribution for the sum as normal dice have faces numbered $(1,2,2,3,3,4)$ and $(1,3,4,5,6,8)$.
