TITLE: Prime generating arithmetical dynamical system
QUESTION [5 upvotes]: Is there a prime generating arithmetical dynamical system, by which I mean, is there a rational function $f$ and a prime $p$ such that the set of values of iterates of $f$ starting at $p$, $I(f) = \{f^{(n)}(p): n \in \mathbb{N}\}$, consists precisely of all primes? Or is there an argument showing that there can not be such an $f$?
If there is no $f$ as above, is there a rational function which, starting at finitely many different primes, altogether produces all the primes when iterated?

REPLY [8 votes]: First, except in some relatively easy to characterize cases, for most rational functions $f(x)\in\mathbb Q(x)$ and most starting rational points $\alpha\in\mathbb Q$, the set of iterates (which is called the orbit)
$$ O_f(\alpha) := \bigl\{ f^{(n)}(\alpha) : n\in\mathbb N \bigr\} $$
will contain only finitely many integers, so it contains only finitely many primes. So you pretty much need to start with a polynomial $f(x)\in\mathbb Q[x]$. Then at least the orbit of an integer may contain infinitely many integers, e.g., this will be the case if the coefficients are integers. But unless the orbit is finite, the size of these integers will grow enormously fast. Again more generally, if you take a rational function $f(x)\in\mathbb Q(x)$ of degree $d\ge2$ and a point $\alpha\in\mathbb Q$ having infinite orbit, and if you write
$$ f^{(n)}(\alpha) = \frac{A_n}{B_n} $$
as a fraction in lowest terms, then
$$ \lim_{n\to\infty} \frac{\log \max\bigl\{ |A_n|,|B_n|\bigr\}}{n^2}  $$
will converge to a positive number, so either the numerator or the denominator will grow at least as fast as $C^{d^n}$ for some $C>1$. (And except for those cases mentioned earlier, the numerator $|A_n|$ and denominator $|B_n|$ will grow at about the same rate; but that's harder to prove.)