login
A253264
Primes p such that q = p^2 - 2, r = q^2 - 2, s = r^2 - 2 and t = s^2 - 2 are all prime.
2
2, 1644103, 3892831, 5178193, 5497949, 5657699, 11078437, 13379917, 14471147, 14890693, 19861879, 25219343, 27671803, 28012511, 29878997, 31848277, 32550769, 34190399, 40630441, 42081719, 47187919, 53964661, 54795553, 55912781, 59327927, 64749281, 68818993
OFFSET
1,1
COMMENTS
Subsequence of A257552, A257551 and A062326.
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