OFFSET
1,1
COMMENTS
Green and Sawhney (see link) proved that there are infinitely many such primes if n == 0 or 4 (mod 6).
If n is odd, p or q must be 2.
If n == 2 (mod 3), p or q must be 3.
Thus if n == 5 (mod 6), the only possible primes of this form are 9 + 4 n and 4 + 9 n.
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
B. Green and M. Sawhney, Primes of the form p^2 + n q^2, arXiv:2410.04189 [math.NT], 2024.
EXAMPLE
a(6) = 73 because 73 = 7^2 + 6 * 2^2 is the least prime of the form p^2 + 6 * q^2.
MAPLE
f:= proc(n) uses priqueue;
local pq, p, t;
if n mod 6 = 5 then
if isprime(3^2 + n * 2^2) then return 3^2 + n*2^2
elif isprime(2^2 + n*3^2) then return 2^2 + n*3^2
else return -1
fi fi;
initialize(pq);
insert([-9 - 4*n, 3, 2], pq);
insert([-4 - 9*n, 2, 3], pq);
if n mod 3 = 2 then
do
t:= extract(pq);
if isprime(-t[1]) then return -t[1] fi;
if t[2] = 3 then p:= nextprime(t[3]); if p = 3 then p:= 5 fi; insert([-9 - n*p^2, 3, p], pq) fi;
if t[3] = 3 then p:= nextprime(t[2]); if p = 3 then p:= 5 fi; insert([-p^2 - n*9, p, 3], pq) fi;
od
else
do
t:= extract(pq);
if isprime(-t[1]) then return -t[1] fi;
if t[3] = 2 then p:= nextprime(t[2]); insert([-p^2 - n*4 , p, 2], pq) fi;
if t[2] = 2 or n::even then
p:= nextprime(t[3]); insert([-t[2]^2 - n*p^2, t[2], p], pq)
fi;
od
fi
end proc:
map(f, [$1..200]);
CROSSREFS
KEYWORD
AUTHOR
Robert Israel, Dec 12 2024
STATUS
approved