login
A300777
Primes of the form a^2 + b^2 such that both a^2 + 3b^2 and 3a^2 + b^2 are prime.
0
5, 29, 53, 113, 449, 653, 701, 809, 953, 1373, 1481, 1709, 1733, 2069, 2549, 2657, 2753, 2909, 3413, 3929, 4397, 5153, 5273, 5693, 6101, 6269, 6449, 6869, 7121, 7529, 7541, 7949, 8297, 8369, 8597, 8849, 9221, 9377, 9629, 10061, 10301, 10313, 10529, 10889, 10973, 11657, 12161, 12401, 12497, 12569
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
Subsequence of A002313.
Sequence in context: A107003 A141374 A147153 * A177831 A115706 A031394
KEYWORD
nonn
AUTHOR
Thomas Ordowski, Mar 12 2018
EXTENSIONS
More terms from Robert Israel and Robert G. Wilson v, Mar 12 2018
STATUS
approved