5. Let $p(x)=2 x^{3}-3 x^{2}+1$. How many squares of integers are among the numbers $p(1), p(2), \ldots$, $p(2016) ?$

#
# Answer: 32.

## Solution:

Notice that $p(x)=(x-1)^{2}(2 x+1)$.

For an integer $x(1 \leq x \leq 2016)$, the number $p(x)=(x-1)^{2}(2 x+1)$ is a perfect square of an integer either when $x=1(p(1)=0)$, or (for $x \geq 2$) when the number $2 x+1$ is a perfect square.

Note that for $x \geq 2$, the inequality holds: $5 \leq 2 x+1 \leq 4033$, and also that $2 x+1$ is odd.

Such squares are the numbers 9 (for $x=4$), 25 (for $x=12$), 49 (for $x=24$), and so on up to $63^{2}=3969$ (for $x=1984$) - that is, we have considered the squares of odd numbers from $3^{2}$ to $63^{2}$ (a total of 31). Together with the previously found square at $x=1$, we get 32 perfect squares among the numbers of the specified form.