This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A258572 #31 Sep 08 2022 08:46:12 %S A258572 15331,3049201,9260131,10239529,10955449,24303469,33491569,42699721, %T A258572 56341711,66241561,87068479,114254629,129783571,143927419,152065549, %U A258572 221977909,235529419,252769399,280028449,284535481,299116021,312896359,349665889,361039519,407462929 %N A258572 Primes p such that p - 2, p^2 - 2, p^3 - 2, p^4 - 2 and p^5 - 2 are all prime. %C A258572 Intersection of A006512, A062326, A178251, A154832 and A154834. %C A258572 Subsequence of primes of A216945. - _Michel Marcus_, Jul 07 2015 %t A258572 Select[Prime[Range[10^8]], And@@PrimeQ[{#, # - 2, #^2 - 2, #^3 - 2, #^4 - 2, #^5 - 2}] &] (* _Vincenzo Librandi_, Jul 06 2015 *) %t A258572 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 *) %o A258572 (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)]; %o A258572 (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 */ %Y A258572 Cf. A006512, A062326, A154832, A154834, A178251, A216945. %K A258572 nonn %O A258572 1,1 %A A258572 _Juri-Stepan Gerasimov_, Jun 03 2015 %E A258572 a(10) corrected and a(14)-a(25) added by _Giovanni Resta_, Jun 05 2015