OFFSET
1,1
COMMENTS
All the terms in the sequence, except a(1), are congruent to 2 mod 3.
LINKS
K. D. Bajpai, Table of n, a(n) for n = 1..3166
MAPLE
KD := proc() local a, b, d; a:=ithprime(n); b:=a+2; d:=a^3+2; if isprime(b)and isprime(d) then RETURN (a); fi; end: seq(KD(), n=1..10000);
MATHEMATICA
Select[Prime[Range[2200]], AllTrue[{#+2, #^3+2}, PrimeQ]&] (* The program uses the AllTrue function from Mathematica version 10 *) (* Harvey P. Dale, Mar 14 2017 *)
PROG
(PARI) s=[]; forprime(p=2, 20000, if(isprime(p+2) && isprime(p^3+2), s=concat(s, p))); s \\ Colin Barker, Apr 01 2014
CROSSREFS
KEYWORD
nonn
AUTHOR
K. D. Bajpai, Apr 01 2014
STATUS
approved