%I #8 Jun 08 2014 14:51:36
%S 0,2,5,6,8,11,15,18,20,24,26,32,33,41,44,45,47,50,54,59,60,65,71,72,
%T 78,80,83,86,89,96,98,99,104,110,122,123,125,128,132,135,137,141,143,
%U 149,150,158,162,164,167,176,177,180,188,195,197,200,206,213,215,216,227,234,236,239,240,242,245
%N Nonnegative integers of the form 2x^2+xy+5y^2.
%C Discriminant -39.
%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)
%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(2,1,5,500);
%Y Primes: A106886.
%K nonn
%O 0,2
%A _N. J. A. Sloane_, Jun 08 2014
|