Let be $\mathcal{P}$ the set of prime numbers.
I would like to determine the set of polynomials $A \in \mathbb{R}[X]$ such that $A(\mathcal{P}) = \mathcal{P}$.
What I have tried so far:
- I proved that, if $\forall p \in \mathcal{P}, A(p) = p$, then: $A = X$.
- Then, if $A \in \mathbb{Z}[X]$, $A(p) \equiv A(0) \pmod{p}$ so that, if $A(0) \equiv 0 \pmod{p}$, then, by the previous statement: $A = X$. Otherwise, I don't see how to proceed whenever $p \nmid A(0)$
- If $A \in \mathbb{Q}[X]$, I think I could get back into $\mathbb{Z}[X]$ by multiplying by the PPCM of all denominators and reuse my previous results.
- If $A \in \mathbb{R}[X]$, I have no idea how to proceed because all prime numbers have non-unique factorization using irrationals and inverses.
- If $A$ is injective, then it must be increasing and we must have $A(2) > A(1) > A(0)$ and $A(2) \geq 2$, at the same time, $A$ must be surjective for prime numbers, so that there must be $x \in \mathcal{P}$ such that $A(x) = 2$, if $A(2) > 2$, then $x < 2$, that's impossible. Then: $x = 2$ and $A(2) = 2$, I guess that we could iterate this idea to get that $A = X$ once again. Now, I know that if $A \neq X$, then $A$ is not injective.
- I tried to look at roots of such polynomial, but I'm not even sure how to use this in $\mathbb{R}[X]$.
Suppose $Q(x)$ is a polynomial sending prime numbers to prime numbers. Let $d$ denote the degree of $Q(x)$. Write $p_k$ for the $k$th prime number. We know $Q(p_j) \in \mathbb{Z}$ for $1\le j \le d+1$, so by e.g. Lagrange interpolation, it follows that $Q(x) \in \mathbb{Q}[x]$. Let $Q(x) = \tilde{Q}(x) / c$ for $\tilde{Q}(x) \in \mathbb{Z}[x]$ and $c\in \mathbb{Z}$ (where $c$ is relatively prime to at least one of the coefficients of $\tilde{Q}$).
Suppose $p$ is any prime large enough such that $Q(p)$ does not divide $c$. If $Q(p)\neq p$, then by Dirichlet's theorem on arithmetic progressions, we can find infinitely many primes $q$ such that $q\equiv p \pmod{Q(p)}$. For each such $q$, we have $$Q(q) \equiv Q(p) \equiv 0 \pmod{Q(p)} \implies Q(q) = Q(p)$$ so the value $Q(p)$ is attained infinitely often by $Q$, contradiction. Hence $Q(p) = p$ for all large enough primes $p$. We conclude $Q(x) = x$.