OFFSET
1,1
COMMENTS
Primes p that remain prime under two iterations of the map p => p^2-2. Note that p=2 is a fixed point of this map.
First primes >2 that remain prime under three iterations of the map p => p^2-2, are 3, 3299, 6323, 9127, 9697, 26357 (A257552).
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
EXAMPLE
p=3, q=7, r=47 all prime,
p=7, q=47, r=2207 all prime,
p=19, q=359, r=128879 all prime.
MAPLE
filter:= proc(p) local q;
if not isprime(p) then return false fi;
q:= p^2-2;
isprime(q) and isprime(q^2-2)
end proc:
select(filter, [2, seq(i, i=3..20000, 2)]); # Robert Israel, Oct 31 2019
MATHEMATICA
Select[Prime@ Range@ 2000, PrimeQ[#^2 - 2] && PrimeQ[Nest[#^2 - 2 &, #, 2]] &] (* Michael De Vlieger, Apr 29 2015 *)
Select[Prime@Range@2000, PrimeQ[#^2 - 2] && PrimeQ[#^4 -4 #^2 + 2] &] (* Vincenzo Librandi, Apr 30 2015 *)
PROG
(Magma) [p: p in PrimesUpTo(15000)| IsPrime(p^4-4*p^2+2)and IsPrime(p^2-2)]; // Vincenzo Librandi, Apr 30 2015
(PARI) forprime(p=1, 10^4, if(isprime(q=p^2-2)&&isprime(q^2-2), print1(p, ", "))) \\ Derek Orr, Apr 30 2015
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Zak Seidov, Apr 29 2015
EXTENSIONS
More terms from Vincenzo Librandi, Apr 30 2015
STATUS
approved