A270972 Primes p such that p-2, p^2-2 and p^3-2 are all prime.
19, 8629, 9721, 12109, 13831, 15331, 17029, 17989, 25849, 33151, 56209, 70999, 73039, 78541, 92461, 97369, 97609, 103069, 103969, 147139, 174469, 179719, 203341, 217369, 221401, 242059, 249541, 269431, 277549, 283009, 285559, 324619, 333451, 346669, 393079, 404269, 409261, 424891, 440551, 488689
Offset: 1
Keywords
Examples
p=19; p-2 = 17 (is prime), p^2-2 = 359 (is prime), p^3-2 = 6857 (is prime).
Programs
-
Magma
[p: p in PrimesUpTo(500000) | IsPrime(p-2) and IsPrime(p^2-2) and IsPrime(p^3-2)]; // Vincenzo Librandi, Mar 28 2016
-
Mathematica
Select[Prime@ Range@ 42000, Function[k, AllTrue[k^# & /@ Range@ 3 - 2, PrimeQ]]] (* Michael De Vlieger, Mar 27 2016, Version 10 *)
-
PARI
lista(nn) = {forprime(p=5, nn, if(isprime(p-2) && isprime(p^2-2) && isprime(p^3-2), print1(p, ", ")));} \\ Altug Alkan, Mar 27 2016
Extensions
More terms from Altug Alkan, Mar 27 2016
Comments