# Partitions of $n$ into distinct odd and even parts proof

Let $p_\text{odd}(n)$ denote the number of partitions of $n$ into an odd number of parts, and let $p_\text{even}(n)$ denote the number of partitions of $n$ into an even number of parts. How do I prove that

1. $|p_\text{even}(n) - p_\text{odd}(n)|$ is equal to the partitions of $n$ into distinct odd parts.

2. Show that the number of partitions of $n$ for which no part appears exactly once is equal to the number of partitions of n for which every part is divisible by 2 or 3.

3. Show that the number of partitions of $n$ for which no part appears more than twice is equal to the number of partitions of $n$ for which no part is divisible by 3.

• The answers to this question give two proofs of a slightly stronger version of (1), one combinatorial and the other via generating functions. – Brian M. Scott Oct 29 '13 at 14:30

For the sake of completeness here is a slightly different approach to part one, which then continues along the path in the link from Brian Scott.

The generating function of the set of partitions by the number of parts is given by $$G(z,u) = \prod_{k\ge 1} \frac{1}{1-uz^k}.$$ It follows that the generating function of the set of partitions with an even number of parts is given by $$G_1(z) = \frac{1}{2} G(z, 1) + \frac{1}{2} G(z, -1) = \frac{1}{2} \prod_{k\ge 1} \frac{1}{1-z^k} + \frac{1}{2} \prod_{k\ge 1} \frac{1}{1+z^k}.$$ Similarly for an odd number of parts, $$G_2(z) = \frac{1}{2} G(z, 1) - \frac{1}{2} G(z, -1) = \frac{1}{2} \prod_{k\ge 1} \frac{1}{1-z^k} - \frac{1}{2} \prod_{k\ge 1} \frac{1}{1+z^k}.$$ Therefore $$G_1(z) - G_2(z) = Q(z) = \prod_{k\ge 1} \frac{1}{1+z^k}$$ and this is the generating function of the difference between the number of partitions into an even and odd number of parts.

Now observe that this is $$\prod_{k\ge 1} \frac{1-z^k}{1-z^{2k}} = \prod_{k\ge 0} (1-z^{2k+1})$$ because the denominator cancels all the factors with even powers in the numerator.

Here is an important observation: the above expression of $Q(z)$ enumerates partitions into unique odd parts in a generating function of signed coefficients where the sign indicates the parity of the number of parts. There is no cancellation between partitions that add up to the same value because the counts of constituent parts have the same parity. Moreover as all parts are odd, partitions of odd numbers must have an odd number of parts and of even numbers, an even number. Therefore the coefficients of $Q(z)$ alternate in sign.

To get the series that generates the absolute values of these coefficients, we create generating functions for the even powers and the odd ones, inverting the sign of the coefficients of the odd ones. The even ones are generated by $$\frac{1}{2} Q(z) + \frac{1}{2} Q(-z)$$ and the odd ones by $$-\left(\frac{1}{2} Q(z) - \frac{1}{2} Q(-z)\right)$$ Adding these gives $$Q(-z).$$ But this is $$\prod_{k\ge 0} (1-(-z)^{2k+1}) = \prod_{k\ge 0} (1-(-1)^{2k+1} z^{2k+1}) = \prod_{k\ge 0} (1+ z^{2k+1}),$$ precisely the generating function of partitions into distinct odd parts.

This is sequence A000700 from the OEIS.

For the second part, the generating function of the partitions in which no part appears exactly once is given by $$\prod_{k\ge 1} \left(-z^k + \frac{1}{1-z^k}\right) = \prod_{k\ge 1} \frac{z^{2k}-z^k+1}{1-z^k} = \prod_{k\ge 1} \frac{1+z^{3k}}{1-z^{2k}}.$$ Now this generating function can be written as $$\prod_{k\ge 1} \frac{1+z^{3k}}{1-z^{2k}} \frac{1-z^{3k}}{1-z^{3k}} = \prod_{k\ge 1} \frac{1-z^{6k}}{(1-z^{2k})(1-z^{3k})}.$$ This precisely the generating function where all parts are divisible by two or three because the factor in the numerator compensates for the fact that parts divisible by six appear twice (once on the left and once on the right) in the two factors in the denominator.

This is sequence A007690 from the OEIS.

Continuing with what Brian Scott started, we have for number three, that this is the generating function for partitions in which no part appears more than twice:$$\prod_{k\ge 1} (1+z^k+z^{2k}).$$ And the generating function for partitions in which no part is divisible by three is $$\prod_{k\ge 0} \frac{1}{1-z^{3k+1}} \prod_{k\ge 0} \frac{1}{1-z^{3k+2}}.$$ Note that the second generating function can be written as $$\prod_{k\ge 1} \frac{1-z^{3k}}{1-z^k}$$ because the numerators cancel all denominators where a power of $z$ appears whose exponent is divisible by three. But we have $$\frac{1-z^{3k}}{1-z^k} = 1 + z^k + z^{2k},$$ proving the claim.

This is sequence A000726 from the OEIS.