TITLE: Checking if polynomial can be iterated and only take prime values
QUESTION [5 upvotes]: I have the polynomial $f(x) = x^2-x+1$ and I am wondering if there is a positive prime value $p$ such that $f(p),f^2(p),f^3(p)\dots$ are all prime.
I have ran some computer simulations and I feel like the answer should be "no" ( because looking at the map $x^2-x+1 \bmod p$ I get that the expected number of prime divisors of the first $M$ values should be larger than $M$). I feel that my analysis is not very good however.
Does anyone know an approach which could be more fruitful?
Note: $f^2(x) = f(f(x))$
Edit: I would be happy with any sort of reference regarding a polynomial staying inside the primes under iteration, if there isn't anything particularly useful which can be said about this sort of thing I understand that as well).

REPLY [5 votes]: This is not an answer to your question, but will point you toward work on the number theoretic properties of such sequences. Iteration of $x^2-x+1$ starting at $a=2$ is called the Sylvester sequence. A theorem about primes that divide the terms in such sequences was proved by Rafe Jones (The density of prime divisors in the arithmetic dynamics of quadratic polynomials. J. Lond. Math. Soc. (2) 78 (2008), no. 2, 523–544. MR2439638) One of his results is that if $k\in\mathbb Z$ with $k\notin\{0,2\}$, then the set of primes dividing the integers in the orbit of any $a\in\mathbb Z$ under iteration of $x^2+kx-1$ has density $0$.
In a different direction, one can prove that the numbers in your sequence, for any starting prime $p$, grow quadratically exponentially, and in fact
$$ \lim_{n\to\infty} \frac{1}{2^n} \log f^n(p) \quad\text{converges
to a positive real number.} $$ Thus your sequence is growing very rapidly, which means that we have very few tools at our disposal to prove statements of the sort you ask.