Given a prime $\,p\,$ let's consider the following sequence:


$a\_0=p$


$a\_{n+1}=(a\_n-2)\cdot a\_n+2$



> 
> **Is it possible to determine whether the sequence $\,a\_n\,$ will reach, sooner or later, another prime number?**
> 
> 
> 


Some examples:


for $\,p=2$, $\;\;a\_1=2\;\;$ (prime)


for $\,p=3$, $\;\;a\_1=5\;\;$ (prime)


for $\,p=29$, $\;\;a\_2=614657\;\;$ (prime)


for $\,p=31$, $\;\;a\_5=185302018885184100000000000000000000000000000001\;\;$ (prime)


Many thanks.




---


[ **Added** ]


Experimental evidence shows that, up to 100, only for the following prime numbers $\,p\,$ the sequence $\,a\_n\,$ should never reach another prime:
$$13,19,23,43,53,59,61,71,73,79$$
In order to find out the possible divisors of $\,a\_n=(p-1)^{2^n}+1\,$ (see the answer of [GH from MO](https://mathoverflow.net/users/11919/gh-from-mo)) the following result can be exploited:


**the only prime divisors of $\,a\_n\,$ are of the form $\,k\cdot2^{n+1}+1$.**


Example:
$$(13-1)^8+1=17\cdot97\cdot260753=(1\cdot2^4+1)\cdot(6\cdot2^4+1)\cdot(16297\cdot2^4+1)$$



Is it possible to determine whether the sequence $\,a_0=p,\;a_{n+1}=(a_n-2)\cdot a_n+2\,$ will reach another prime number?
Your question can be reformulated as follows.


**Question.** If $p$ is a prime, does there always exist a positive integer $n$ such that $(p-1)^{2^n}+1$ is also a prime?


I believe that this question is out of reach at present (my guess is that the answer is "no", but we will never know). Similar to the well-known questions on [Fermat numbers](https://en.wikipedia.org/wiki/Fermat_number) and its [generalizations](https://primes.utm.edu/glossary/page.php?sort=GeneralizedFermatNumber).


