From 2870 balls, how many layers of a regular quadrilateral pyramid can we form.
In the first, second, $\ldots n$-th layer, there are $1^{2}, 2^{2}, \ldots n^{2}$ balls. Therefore, in $n$ layers, there are

$$
1^{2}+2^{2}+3^{2}+\cdots+n^{2}=2870
$$

But

$$
1^{2}+2^{2}+3^{2}+\cdots+n^{2}=\frac{n(n+1)(2 n+1)}{6}
$$

so

$$
2 n^{3}+3 n^{2}+n=17220
$$

from which the real value of $n$ is:

$$
n=20
$$

(István Szabó.)

Number of solutions: 31.