OFFSET
1,1
LINKS
K. D. Bajpai, Table of n, a(n) for n = 1..163
EXAMPLE
23 is in the sequence because 23 is prime and prime(prime(23^2)) + 2 = 35803 is also prime.
97 is in the sequence because 97 is prime and prime(prime(97^2)) + 2 = 1269643 is also prime.
MAPLE
KD := proc() local a, b, d; a:=ithprime(n); b:=ithprime(ithprime(a^2))+2; if isprime (b) then RETURN (a); fi; end: seq(KD(), n=1..300);
MATHEMATICA
n=0; Do[If[PrimeQ[Prime[Prime[Prime[k]^2]]+2], n=n+1; Print[n, " ", Prime[k]]], {k, 1, 5000}]
Select[Prime[Range[800]], PrimeQ[Prime[Prime[#^2]]+2]&] (* Harvey P. Dale, Dec 19 2014 *)
CROSSREFS
KEYWORD
nonn,less
AUTHOR
K. D. Bajpai, Feb 19 2014
STATUS
approved