OFFSET
1,1
LINKS
K. D. Bajpai, Table of n, a(n) for n = 1..564
EXAMPLE
17 is prime and appears in the sequence because prime(17^2) = 1879 and 1879 - 2 = 1877, which is also prime.
47 is prime and appears in the sequence because prime(47^2) = 19471 and 19471 - 2 = 19469, which is also prime.
MAPLE
KD := proc() local a, b, d; a:=ithprime(n); b:=ithprime(a^2)-2; if isprime (b) then RETURN (a); fi; end: seq(KD(), n=1..500);
PROG
(PARI)
default(primelimit, 2^31)
s=[]; forprime(p=2, 5000, if(isprime(prime(p^2)-2), s=concat(s, p))); s \\ Colin Barker, Jan 30 2014
CROSSREFS
KEYWORD
nonn
AUTHOR
K. D. Bajpai, Jan 29 2014
STATUS
approved