TITLE: Solutions to $a_1+2a_2+\cdots+ka_k = 1979$
QUESTION [5 upvotes]: For $k = 1,2,\ldots$ consider the $k$-tuples $(a_1,a_2,\ldots,a_k)$ of positive integers such that $$a_1+2a_2+\cdots+ka_k = 1979.$$ Show that there are as many such $k$-tuples with odd $k$ as there are with even $k$.

We know that we need only check up to $k = 62$ because otherwise it is just $0$. Since I don't see an easy way of counting solutions to $a_1+2a_2+3a_3 = 1979$ for example, is there something else we could do to prove the question?
Also it is interesting to note that $1979$ is a prime. Although the result doesn't seem easily generalizable if we replace $1979$ by some other integer.
I tried the following.
Attempt:
We first see that the number of solutions for some $k$ is given by the coefficient of $x^{1979}$ in the expansion of $$(x+x^2+\cdots)(x^2+x^4+\cdots)\cdots(x^{k}+x^{2k}+\cdots) = \prod_{i=1}^k\dfrac{x^i}{1-x^{i}}.$$ Thus, we need to show that $$Q(x) = \sum_{k=1; 2 \mid k}^{62}\left(\prod_{i=1}^k\dfrac{x^i}{1-x^{i}}\right)-\sum_{k = 1; 2 \nmid k}^{61}\left(\prod_{i=1}^k\dfrac{x^i}{1-x^{i}}\right)$$ doesn't contain the term $x^{1979}$ in its expansion.

REPLY [4 votes]: Let $(a_1, \cdots , a_k)$ be a solution to the desired equation. Note that this describes a partition of $1979$ given as
$$\lambda = (a_1 \times 1, a_2\times 2, a_3\times 3, \cdots , a_k\times k),$$
i.e. each positive solution describes a unique partition of $1979$ with largest part $k$. Turning the Young diagram of the partition sideways, this translates to a partition with exactly $k$ parts. In fact, you can check that the stipulation that $a_i > 0$ translates to the fact that we get a partition with not only exactly $k$ parts but $k$ distinct parts.
Therefore we have a bijection with solutions $k$-tuples solutions and partitions with exactly $k$ distinct parts. Out problem is therefore reduced to proving that the number of partitions of $1979$ into an even number of distinct parts is exactly equal to the number of partitions of $1979$ into an odd number of distinct parts.
This was a problem tackled by Euler, whose solution is encapsulated in his pentagonal number theorem.
Euler's Pentagonal Number Theorem: Let $P_{DE}(n)$ and $P_{DO}(n)$ denote the number of partitions of $n$ with an even/odd number of distinct parts respectively. Then
$$P_{DE}(n) - P_{DO}(n) = \begin{cases}(-1)^k & n=\frac{3k^2-k}{2}\\ 0 & \text{otherwise}\end{cases}.$$
In particular, the number of distinct even and odd partitions are equal except when $n$ is a generalized pentagonal number.
The proof of this theorem is not very difficult and is available in many places online so I won't prove it here.
The result now follows by noting that $1979$ is not a generalized pentagonal number (which it is not).