Can you provide a proof or a counterexample for the following claim : >Let $P_m(x)=2^{-m}\cdot((x-\sqrt{x^2-4})^m+(x+\sqrt{x^2-4})^m)$ . Let $F_n(2p)= (2p)^{2^n}+1 $ where $p$ is a prime number greater than $5$ , and $n\ge2$ . Let $S_i=P_{2p}(S_{i-1})$ with $S_0=P_{p^2}(8)$ , then $$F_n(2p) \text{ is prime iff } S_{2^n-2} \equiv 0 \pmod{F_n(2p)}$$ . You can run this test [here][1] . A list of generalized Fermat primes sorted by base can be found [here][2] . I have verified this claim for $p \in [7,5000]$ with $n \in [2,10]$ and there were no counterexamples . [1]: https://sagecell.sagemath.org/?z=eJxdjLEKwjAURfd-xbNT0kZqguIQXxdxtPgFBVsjDbQvIYmKf28cXJwu597LaSo4UTIB6LEMJkTwcKUbEDDf7kAAtZIDVE3hUe41odJFRFV5N4-TGd5xMk_meyWk2HJddMjyxnvVUy11MaaAOV6TnQ3LcMA8rJWIeHY39mfJmC2xUVx0XOd3jTIr7Z1FxI3wwVJi5SXYxaxK_uOjW7yLNn07rj8k_jyd&lang=gp&interacts=eJyLjgUAARUAuQ== [2]: http://jeppesn.dk/generalized-fermat.html