OFFSET
1,1
COMMENTS
MATHEMATICA
Select[Prime[Range[10^8]], And@@PrimeQ[{#, # - 2, #^2 - 2, #^3 - 2, #^4 - 2, #^5 - 2}] &] (* Vincenzo Librandi, Jul 06 2015 *)
Select[Prime[Range[2172*10^4]], AllTrue[#^Range[5]-2, PrimeQ]&] (* The program uses the AllTrue function from Mathematica version 10 *) (* Harvey P. Dale, Dec 02 2018 *)
PROG
(Magma) [p: p in PrimesUpTo(40000000) | IsPrime(p^1-2) and IsPrime(p^2-2) and IsPrime(p^3-2) and IsPrime(p^4-2) and IsPrime(p^5-2)];
(PARI) first(m)=my(v=vector(m), i, p, t=1); for(i=1, m, while(1, p=prime(t); if(isprime(p-2)&&isprime(p^2 - 2)&&isprime(p^3 - 2)&&isprime(p^4 - 2)&&isprime(p^5 - 2), v[i]=p; break, t++)); t++); v; /* Anders Hellström, Jul 17 2015 */
CROSSREFS
KEYWORD
nonn
AUTHOR
Juri-Stepan Gerasimov, Jun 03 2015
EXTENSIONS
a(10) corrected and a(14)-a(25) added by Giovanni Resta, Jun 05 2015
STATUS
approved