Problem

Source: 2017 Saudi Arabia IMO TST III p1

Tags: algebra, polynomial, number theory, sum of digits



For any positive integer $k$, denote the sum of digits of $k$ in its decimal representation by $S(k)$. Find all polynomials $P(x)$ with integer coefficients such that for any positive integer $n \ge 2017$, the integer $P(n)$ is positive and $S(P(n)) = P(S(n))$.