OFFSET
1,1
COMMENTS
Are there primes p > 2 such that t = s^2 - 2 is also prime?
t = s^2 - 2 is prime for p = 1644103, 3892831, 5178193, 5497949, 5657699, ... - Chai Wah Wu, Apr 30 2015
LINKS
Chai Wah Wu, Table of n, a(n) for n = 1..1000
EXAMPLE
3 is in the sequence because 3^2 - 2 = 7, 7^2 - 2 = 47 and 47^2 - 2 = 2207 are all primes.
5 is not in the sequence, because, although 5^2 - 2 = 23 is prime, 23^2 - 2 = 527 = 17 * 31.
MATHEMATICA
Select[Prime@ Range@ 100000, PrimeQ[#^2 - 2] && PrimeQ[Nest[#^2 - 2 &, #, 2]] && PrimeQ[Nest[#^2 - 2 &, #, 3]] &] (* Michael De Vlieger, Apr 29 2015 *)
Select[Prime@Range@60000, PrimeQ[#^2 - 2] && PrimeQ[#^4 - 4 #^2 + 2] && PrimeQ[#^8 - 8 #^6 + 20 #^4 - 16 #^2 + 2] &] (* Vincenzo Librandi, Apr 30 2015 *)
Select[Prime[Range[10^4]], Union[PrimeQ[{#^2 - 2, #^4 - 4#^2 + 2, #^8 - 8#^6 + 20#^4 - 16#^2 + 2}]] == {True} &] (* Alonso del Arte, May 01 2015 *)
PROG
(Magma) [p: p in PrimesUpTo(1500000)| IsPrime(p^4-4*p^2+2)and IsPrime(p^2-2)and IsPrime(p^8-8*p^6+20*p^4-16*p^2+2)]; // Vincenzo Librandi, Apr 30 2015
(Python)
from gmpy2 import is_prime, next_prime
A257552_list, p = [], 2
for _ in range(10**9):
....q = p**2 - 2
....if is_prime(q):
........r = q**2 -2
........if is_prime(r):
............s = r**2-2
............if is_prime(s):
................A257552_list.append(p)
....p = next_prime(p) # Chai Wah Wu, Apr 30 2015
(Perl) use Math::GMP ":constant"; use ntheory ":all"; my($q, $r, $s); forprimes { say if is_prime($q=$_**2-2) && is_prime($r=$q**2-2) && is_prime($s=$r**2-2); } 1e9; # Dana Jacobsen, May 02 2015
CROSSREFS
KEYWORD
nonn
AUTHOR
Zak Seidov, Apr 29 2015
EXTENSIONS
More terms from Vincenzo Librandi, Apr 30 2015
STATUS
approved