Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.
%I #23 Sep 08 2022 08:46:16
%S 19,8629,9721,12109,13831,15331,17029,17989,25849,33151,56209,70999,
%T 73039,78541,92461,97369,97609,103069,103969,147139,174469,179719,
%U 203341,217369,221401,242059,249541,269431,277549,283009,285559,324619,333451,346669,393079,404269,409261,424891,440551,488689
%N Primes p such that p-2, p^2-2 and p^3-2 are all prime.
%C Subsequence of A006512. - _Altug Alkan_, Mar 27 2016
%e p=19; p-2 = 17 (is prime), p^2-2 = 359 (is prime), p^3-2 = 6857 (is prime).
%t Select[Prime@ Range@ 42000, Function[k, AllTrue[k^# & /@ Range@ 3 - 2, PrimeQ]]] (* _Michael De Vlieger_, Mar 27 2016, Version 10 *)
%o (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
%o (Magma) [p: p in PrimesUpTo(500000) | IsPrime(p-2) and IsPrime(p^2-2) and IsPrime(p^3-2)]; // _Vincenzo Librandi_, Mar 28 2016
%Y Cf. A000040, A001248, A006512, A030078, A049001, A040976, A153481.
%K nonn
%O 1,1
%A _Emre APARI_, Mar 27 2016
%E More terms from _Altug Alkan_, Mar 27 2016