# Interesting third degree polynomial

Let $$P(x)$$ be a third-degree polynomial with coefficients as natural numbers, and the constant term of $$P(x)$$ is $$1$$, and the sum of the coefficients of $$P(x)$$ is $$2020$$. Prove that there exist positive integers $$a$$ such that $$(P(a))^2$$ and $$P(a)$$ have different units digits when written in the decimal system.

This question comes from the book: Đa thức (Polynomial) - Nguyen Tien Lam.

Let P(x) = $$mx^3+nx^2+px+1$$ and $$m+n+p=2019$$, and i can't go any further.

The problem is the same as showing that there exist integers $$x$$ such that

$$P(x)^2 \not \equiv P(x) \pmod{10}.$$

For the time being, I propose a bad solution. I believe that there exists a much simpler, beautiful solution to this:

Let me consider few cases:

$$\textbf{Case 1.}$$ Suppose $$n\equiv 0, 1,3,5, 6, 8 \pmod{10}$$. Then, consider $$x\equiv 9 \pmod {10}$$. We can easily see that

$$P(x) \equiv 9m+n+9p+1 \equiv 9m+9n+9p+2n+1 \pmod{10}.$$

That is

$$P(x) \equiv 9(m+n+p) + (2n+1) \equiv 1+(2n+1) \pmod{10} \equiv 2n+2 \pmod {10}.$$

Here I have used your observation that $$m+n+p\equiv 9\pmod{10}$$. Clearly for the given condition on $$n$$, we can easily infer that

$$P(x) \not\equiv 0, 1, 5, 6 \pmod{10}.$$

Thus $$P^2(x) \not \equiv P(x) \pmod {10},$$ in this case.

$$\textbf{Case 2.}$$ Suppose $$n\equiv 2, 7 \pmod{10}$$. We now proceed with two cases based on the nature of $$m$$. Suppose $$m\equiv 1,2,3,6,7,8 \pmod{10}$$. Consider $$x\equiv 3 \pmod {10}$$. We, then would have

$$P(x) \equiv 7m+9n+3p+1 \equiv 3(m+n+p)+4m+6n+1 \pmod{10}.$$

That is

$$P(x) \equiv 4m+6n+8 \pmod{10},$$ where we have used $$m+n+p \equiv 9 \pmod {10}$$. Now, for the given condition on $$n$$, we can easily see that

$$P(x) \equiv 4m \pmod{10}.$$

Now, for the values of $$m$$ chosen, we have

$$P(x) \not \equiv 0, 1, 5, 6 \pmod{10}.$$

Thus, in this case $$P(x)^2 \not \equiv P(x) \pmod{10}.$$

Now, consider the second case, $$m\equiv 0,4,5,9 \pmod{10}$$. Choose $$x\equiv 7 \pmod{10}$$. Then

$$P(x) \equiv 3m+9n+7p+1 \equiv 7(m+n+p)+6m+2n+1 \equiv 6m+8 \pmod{10},$$ for the given values of $$n$$. Thus for the given values of $$m$$, it can be easily seen that

$$P(x) \not\equiv 0,1,5,6 \pmod{10}$$

Hence $$P(x)^2 \not \equiv P(x) \pmod{10}$$ in this case.

$$\textbf{Case 3.}$$ Suppose $$n\equiv 4, 9 \pmod{10}$$. In this case, suppose $$m\equiv 0, 3, 4, 5, 8, 9 \pmod{10}$$. Choose $$x\equiv 3 \pmod{10}$$. Then, clearly $$P(x) \equiv 7m+9n+3p+1 \pmod{10} \equiv 3(m+n+p)+4m+6n+1 \pmod{10}.$$

That is

$$P(x) \equiv 4m+6n+8 \pmod{10}.$$

For the given values of $$n$$, we have

$$P(x) \equiv 4m+2 \not \equiv 0,1,5,6 \pmod{10},$$ for the given values of $$m$$. Thus, in this case $$P(x)^2 \not \equiv P(x) \pmod{10}.$$ Suppose $$m\equiv 1, 2, 6, 7 \pmod{10}$$. Consider $$x\equiv 7 \pmod{10}$$. Then

$$P(x) \equiv 3m+9n+7p+1 \equiv 7(m+n+p)+6m+2n+1\pmod{10}.$$

Then,

$$P(x) \equiv 6m+2n+4 \equiv 6m+2 \pmod{10},$$ for the given values of $$n$$. Clearly for the values of $$m$$ chosen, we will have $$P(x) \not\equiv 0,1,5,6\pmod{10}$$. Hence, $$P(x)^2 \not\equiv P(x) \pmod{10}$$.

We have covered all the cases.

Suppose that $$(P(a))^2$$ and $$P(a)$$ have the same units digit in decimal for every integer $$a$$. Then for all $$a$$ you have $$P(a)\equiv0,1\pmod{5}$$, and so every element of $$\Bbb{F}_5$$ is either a root of $$P(x)$$ or of $$P(x)-1$$. Both are nonzero cubics over $$\Bbb{F}_5$$ because $$P(0)\equiv1\pmod{5}$$ and $$P(1)\equiv0\pmod{5}$$. It follow that one of them has three roots and the other has two roots in $$\Bbb{F}_5$$. This is of course impossible because they are cubics.