OFFSET
1,1
COMMENTS
The primes p of the form x^2 + 18480*y^2 are also of the multi-forms x^2 + y^2, x^2 + 2*y^2, x^2 + 3*y^2, ..., x^2 + 11*y^2, x^2 + 12*y^2, but the reverse is false. For example, p = 7561 has twelve forms, but is not of the form x^2 + 18480*y^2.
REFERENCES
David A. Cox, "Primes of the Form x^2 + n*y^2", Wiley, 1989, Section 3.
J.-M. De Koninck, Ces nombres qui nous fascinent, Entry 1848, p. 146, Ellipses, Paris 2008.
LINKS
Ray Chandler, Table of n, a(n) for n = 1..10000
N. J. A. Sloane et al., Binary Quadratic Forms and OEIS (Index to related sequences, programs, references)
M. Waldschmidt, Open Diophantine problems, arXiv:math/0312440 [math.NT], 2003-2004.
EXAMPLE
18481 = 1^2 + 18480*1^2 and also 18481 = 16^2 + 135^2 = 7^2 + 2*96^2 = 127^2 + 3*28^2 = 135^2 + 4*8^2 = 74^2 + 5*51^2 = 59^2 + 6*50^2 = 97^2 + 7*36^2 = 7^2 + 8*48^2 = 16^2 + 9*45^2 = 29^2 + 10*42^2 = 65^2 + 11*36^2 = 127^2 + 12*14^2.
MAPLE
fd:=proc(a, b, c, M) local dd, xlim, ylim, x, y, t1, t2, t3, t4, i;
dd:=4*a*c-b^2;
if dd<=0 then error "Form should be positive definite."; break; fi;
t1:={};
xlim:=ceil( sqrt(M/a)*(1+abs(b)/sqrt(dd)));
ylim:=ceil( 2*sqrt(a*M/dd));
for x from 0 to xlim do
for y from -ylim to ylim do
t2 := a*x^2+b*x*y+c*y^2;
if t2 <= M then t1:={op(t1), t2}; fi; od: od:
t3:=sort(convert(t1, list));
t4:=[];
for i from 1 to nops(t3) do
if isprime(t3[i]) then t4:=[op(t4), t3[i]]; fi; od:
[[seq(t3[i], i=1..nops(t3))], [seq(t4[i], i=1..nops(t4))]];
end;
fd(1, 0, 18480, 100000);
MATHEMATICA
QuadPrimes2[1, 0, 18480, 100000] (* see A106856 *)
(* Second program: *)
max = 107000; m = 18480; Table[yy = {y, 1, Floor[Sqrt[max-x^2]/(Sqrt[m])]}; Table[x^2 + m y^2, yy // Evaluate], {x, 0, Floor[Sqrt[max]]}] // Flatten // Union // Select[#, PrimeQ]&
PROG
(PARI)
fc(a, b, c, M) = {
my(t1=List(), t2);
forprime(p=2, prime(M),
t2 = qfbsolve(Qfb(a, b, c), p);
if(t2 != 0, listput(t1, p))
);
Vec(t1)
};
fc(1, 0, 18480, 100000)
CROSSREFS
KEYWORD
nonn
AUTHOR
Michel Lagneau, Feb 14 2010, Jun 08 2010
EXTENSIONS
Corrected sequence and replaced defective program. - Ray Chandler, Aug 14 2014
STATUS
approved