12. (VIE 2) The polynomial $1976\left(x+x^{2}+\cdots+x^{n}\right)$ is decomposed into a sum of polynomials of the form $a_{1} x+a_{2} x^{2}+\ldots+a_{n} x^{n}$, where $a_{1}, a_{2}, \cdots, a_{n}$ are distinct positive integers not greater than $n$. Find all values of $n$ for which such a decomposition is possible.
12. Suppose the decomposition into $k$ polynomials is possible. The sum of coefficients of each polynomial $a_{1} x+a_{2} x^{2}+\cdots+a_{n} x^{n}$ equals $1+\cdots+n=n(n+1)/2$ while the sum of coefficients of $1976(x+x^{2}+\cdots+x^{n})$ is $1976n$. Hence we must have $1976n = k n(n+1)/2$, which reduces to $(n+1) \mid 3952 = 2^4 \cdot 13 \cdot 19$. In other words, $n$ is of the form $n = 2^{\alpha} 13^{\beta} 19^{\gamma} - 1$, with $0 \leq \alpha \leq 4, 0 \leq \beta \leq 1, 0 \leq \gamma \leq 1$. We can immediately eliminate the values $n = 0$ and $n = 3951$ that correspond to $\alpha = \beta = \gamma = 0$ and $\alpha = 4, \beta = \gamma = 1$. We claim that all other values $n$ are permitted. There are two cases. $\alpha \leq 3$. In this case $k = 3952 / (n+1)$ is even. The simple choice of the polynomials $P = x + 2x^{2} + \cdots + nx^{n}$ and $P' = nx + (n-1)x^{2} + \cdots + x^{n}$ suffices, since $k(P + P') / 2 = 1976(x + x^{2} + \cdots + x^{n})$. $\alpha = 4$. Then $k$ is odd. Consider $(k-3) / 2$ pairs $(P, P')$ of the former case and 
$$ \begin{aligned} P_{1} = & \left[n x + (n-1) x^{3} + \cdots + \frac{n+1}{2} x^{n}\right] \\ & + \left[\frac{n-1}{2} x^{2} + \frac{n-3}{2} x^{4} + \cdots + x^{n-1}\right] \\ P_{2} = & \left[\frac{n+1}{2} x + \frac{n-1}{2} x^{3} + \cdots + x^{n}\right] \\ & + \left[n x^{2} + (n-1) x^{4} + \cdots + \frac{n+3}{2} x^{n-1}\right] \end{aligned} $$
Then $P + P_{1} + P_{2} = 3(n+1)(x + x^{2} + \cdots + x^{n}) / 2$ and therefore $(k-3)(P + P') / 2 + (P + P_{1} + P_{2}) = 1976(x + x^{2} + \cdots + x^{n})$. It follows that the desired decomposition is possible if and only if $1 < n < 3951$ and $n+1 \mid 2 \cdot 1976$.