OFFSET
1,1
LINKS
Chai Wah Wu, Table of n, a(n) for n = 1..1000
MATHEMATICA
Select[Prime@Range@6000000, PrimeQ[#^2 - 2] && PrimeQ[#^4 - 4 #^2 + 2] && PrimeQ[#^8 - 8 #^6 + 20 #^4 - 16 #^2 + 2] && PrimeQ[(#^8 - 8 #^6 + 20 #^4 - 16 #^2 + 2)^2 - 2] &] (* Vincenzo Librandi, May 01 2015 *)
apQ[p_]:=Module[{q=p^2-2, r, s}, r=q^2-2; s=r^2-2; AllTrue[ {q, r, s, s^2-2}, PrimeQ]]; Select[Prime[Range[4053000]], apQ] (* Harvey P. Dale, Mar 27 2022 *)
PROG
(Magma) [p: p in PrimesUpTo(2*10^7) | IsPrime(p^2-2) and IsPrime(p^4-4*p^2+2) and IsPrime(p^8-8*p^6+20*p^4-16*p^2+2) and IsPrime((p^8-8*p^6+20*p^4-16*p^2+2)^2-2)]; // Vincenzo Librandi, May 01 2015
(Python)
from gmpy2 import is_prime, next_prime
A253264_list, p = [], 2
for _ in range(10**7):
q = p**2 - 2
if is_prime(q):
r = q**2 -2
if is_prime(r):
s = r**2-2
if is_prime(s) and is_prime(s**2-2):
A253264_list.append(p)
p = next_prime(p) # Chai Wah Wu, May 02 2015
(Perl) use Math::GMP ":constant"; use ntheory ":all"; my($q, $r, $s, $t); forprimes { say if is_prime($q=$_**2-2) && is_prime($r=$q**2-2) && is_prime($s=$r**2-2) && is_prime($t=$s**2-2); } 1e12; # Dana Jacobsen, May 02 2015
CROSSREFS
KEYWORD
nonn
AUTHOR
Zak Seidov, Apr 30 2015
EXTENSIONS
First term and additional terms added from Vincenzo Librandi, May 01 2015
STATUS
approved