Let be $A$ the set of integers non-negative which only have 1 in their base 10 expansion (e.g. $111111$, $11$, $1$).
I would like to find all polynomials $P \in \mathbb{C}[X]$ such that $P(A) \subset A$.
My intuition is that: only $P_k = 10^k X + \sum_{i=0}^{k - 1} 10^i = 10^k X + \dfrac{10^k - 1}{9}$ for all $k \geq 0$ are solutions.
But I'm not sure how to proceed.
I tried to let be $(u_n)_n$ the number with $n$ $1$ in its base 10 expansion, e.g. $u_n = \underset{n \text{ 1s}}{111111111\ldots111} = \dfrac{10^n - 1}{9}$.
And I know there is $(k_n)_n$ such that $P(u_n) = u_{k_n}$ by hypothesis.
Also, I know, for all $k \geq 0$, there is $j \geq 0$ such that:
\begin{equation*} 9P\left(\dfrac{10^k - 1}{9}\right) = 10^j - 1 \end{equation*}
Of course, such a polynomial must be in $\mathbb{Q}[X]$ by interpolation.
I would be tempted to try to evaluate $P(0)$ and use it to guess the good $k$ and show that it must be equal to $P_k$ over an infinite set (maybe asymptotically?).
Suppose the degree of $P$ is $n$. Then we know that, for all sufficiently large $k$, $P(\frac{10^k-1}{9})=\frac{10^{kn+c}-1}{9}$ which tells us that, since $P(x)-\frac{10^c (9x+1)^n-1}{9}$ is $0$ infinitely often, it is the $0$ polynomial, that is, $P(x)=\frac{10^c (9x+1)^n-1}{9}$.
See http://homepages.se.edu/kfrinkle/files/2013/08/Putnam2007s.pdf for original question source.