OFFSET
1,1
COMMENTS
Primes of the form (x^2+y^2)/2 such that both x^2+xy+y^2 and x^2-xy+y^2 are prime.
Note that a^2+b^2 = ((a+b)^2+(a-b)^2)/2.
FORMULA
a(n) == 1 (mod 4).
EXAMPLE
The prime 29 = 5^2 + 2^2 is a term, because 5^2 + 3*2^2 = 37 is prime and 3*5^2 + 2^2 = 79 is prime.
Equivalently: 29 = ((5+2)^2 + (5-2)^2)/2 = (7^2 + 3^2)/2 is a term, because 7^2 + 7*3 + 3^2 = 79 is prime and 7^2 - 7*3 + 3^2 = 37 is prime.
MAPLE
N:= 10^5: Res:= NULL:
for a from 1 to isqrt(N) by 2 do
for b from 2 to floor(sqrt(N-a^2)) by 2 do
if isprime(a^2+b^2) and isprime(a^2+3*b^2) and isprime(3*a^2+b^2)
then Res:= Res, a^2+b^2
fi
od od:
sort([Res]); # Robert Israel, Mar 12 2018
MATHEMATICA
lst = {}; nmx = 120; Do[ If[ PrimeQ[a^2 + b^2] && PrimeQ[3a^2 + b^2] && PrimeQ[a^2 + 3b^2], AppendTo[lst, a^2 + b^2]], {a, nmx}, {b, a, nmx}]; Take[ Sort@ Flatten@ lst, 50] (* Robert G. Wilson v, Mar 12 2018 *)
PROG
(PARI) lista(nn) = {vres = []; forstep(a=1, sqrtint(nn), 2, forstep(b=2, sqrtint(nn-a^2), 2, if (isprime(a^2+b^2) && isprime(a^2+3*b^2) && isprime(3*a^2+b^2), vres = concat(vres, a^2+b^2)); ); ); vecsort(vres); } \\ Michel Marcus, Apr 25 2018, after Maple
CROSSREFS
KEYWORD
nonn
AUTHOR
Thomas Ordowski, Mar 12 2018
EXTENSIONS
More terms from Robert Israel and Robert G. Wilson v, Mar 12 2018
STATUS
approved