%I #30 Oct 08 2018 08:14:01
%S 18481,19009,19441,20161,21961,31249,41281,47041,48409,51241,68209,
%T 70009,70921,74209,74449,74761,75289,76129,76561,77641,80809,84121,
%U 85369,86689,87649,90841,91081,91921,93241,97441,102001,102481,106681
%N Primes of the form x^2 + 18480*y^2.
%C 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.
%D David A. Cox, "Primes of the Form x^2 + n*y^2", Wiley, 1989, Section 3.
%D J.-M. De Koninck, Ces nombres qui nous fascinent, Entry 1848, p. 146, Ellipses, Paris 2008.
%H Ray Chandler, <a href="/A173274/b173274.txt">Table of n, a(n) for n = 1..10000</a>
%H N. J. A. Sloane et al., <a href="https://oeis.org/wiki/Binary_Quadratic_Forms_and_OEIS">Binary Quadratic Forms and OEIS</a> (Index to related sequences, programs, references)
%H M. Waldschmidt, <a href="https://arxiv.org/abs/math/0312440">Open Diophantine problems</a>, arXiv:math/0312440 [math.NT], 2003-2004.
%e 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.
%p fd:=proc(a,b,c,M) local dd,xlim,ylim,x,y,t1,t2,t3,t4,i;
%p dd:=4*a*c-b^2;
%p if dd<=0 then error "Form should be positive definite."; break; fi;
%p t1:={};
%p xlim:=ceil( sqrt(M/a)*(1+abs(b)/sqrt(dd)));
%p ylim:=ceil( 2*sqrt(a*M/dd));
%p for x from 0 to xlim do
%p for y from -ylim to ylim do
%p t2 := a*x^2+b*x*y+c*y^2;
%p if t2 <= M then t1:={op(t1),t2}; fi; od: od:
%p t3:=sort(convert(t1,list));
%p t4:=[];
%p for i from 1 to nops(t3) do
%p if isprime(t3[i]) then t4:=[op(t4),t3[i]]; fi; od:
%p [[seq(t3[i],i=1..nops(t3))], [seq(t4[i],i=1..nops(t4))]];
%p end;
%p fd(1,0,18480,100000);
%t QuadPrimes2[1, 0, 18480, 100000] (* see A106856 *)
%t (* Second program: *)
%t 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]&
%o (PARI)
%o fc(a,b,c,M) = {
%o my(t1=List(),t2);
%o forprime(p=2,prime(M),
%o t2 = qfbsolve(Qfb(a,b,c),p);
%o if(t2 != 0, listput(t1,p))
%o );
%o Vec(t1)
%o };
%o fc(1,0,18480,100000)
%Y Cf. A139668: primes of the form x^2 + 1848*y^2;
%Y Cf. A139665: primes of the form x^2 + 840*y^2.
%K nonn
%O 1,1
%A _Michel Lagneau_, Feb 14 2010, Jun 08 2010
%E Corrected sequence and replaced defective program. - _Ray Chandler_, Aug 14 2014