A \emph{repunit} is a positive integer whose digits in base 10 are all ones. Find all polynomials with real coefficients such that if is a repunit, then so is .
Solution
Note that is a repunit if and only if for some power of 10 greater than 1. Consequently, if we put
then takes repunits to repunits if and only if takes powers of 10 greater than 1 to powers of 10 greater than 1. We will show that the only such functions are those of the form for , (all of which clearly work), which will mean that the desired polynomials are those of the form
for the same .
It is convenient to allow "powers of 10" to be of the form for any integer . With this convention, it suffices to check that the polynomials taking powers of 10 greater than 1 to powers of 10 are of the form for any integers with .
\textbf{First solution:}
Suppose that the leading term of is , and note that . As , we have ; however, for a power of 10 greater than 1, is a power of 10. The set of powers of 10 has no positive limit point, so must be equal to for with sufficiently large, and we must have for some . The polynomial has infinitely many roots, so must be identically zero.
\textbf{Second solution:}
We proceed by induction on . If , we have for some . Otherwise, has rational coefficients by Lagrange's interpolation formula (this applies to any polynomial of degree taking at least different rational numbers to rational numbers), so is rational. Moreover, takes each value only finitely many times, so the sequence includes arbitrarily large powers of 10. Suppose that ; then we can choose a positive integer such that the numerator of is not divisible by . But for large enough, has numerator divisible by for some , contradiction.
Consequently, , and we may apply the induction hypothesis to to deduce the claim.
\textbf{Remark:} The second solution amounts to the fact that , being a polynomial with rational coefficients, is continuous for the -adic and -adic topologies on . By contrast, the first solution uses the "\infty-adic" topology, i.e., the usual real topology.