OFFSET
1,1
COMMENTS
Except for 2 and 3, all terms == 5 (mod 6). If p == 2 (mod 3), q == 1 (mod 3), and so q^2+q+1 is divisible by 3.
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
EXAMPLE
a(3)=41 is a term because 41^2+41+1=1723 is prime and (1723^2+1723+1)/3=990151 is prime.
MAPLE
filter:= proc(p) local r;
r:= p^2 + p + 1;
isprime(p) and isprime(r) and isprime((r^2+r+1)/3)
end proc:
select(filter, [2, 3, seq(i, i=5..10^5, 6)]); # Robert Israel, Dec 25 2018
MATHEMATICA
f[n_] := n^2 + n + 1; Select[Range[45000], PrimeQ[#] && PrimeQ[f[#]] && PrimeQ[f[f[#]]/3] &] (* Amiram Eldar, Dec 25 2018 *)
PROG
(PARI) is(n) = isprime(n) && isprime(q=(n^3-1)/(n-1)) && isprime((q^3-1)/(3*q-3)) \\ David A. Corneth, Dec 25 2018
CROSSREFS
KEYWORD
nonn
AUTHOR
Robert Israel, Dec 25 2018
STATUS
approved