%I #8 Jul 25 2014 10:56:51
%S 0,3,4,10,12,13,16,22,25,27,30,36,40,48,52,55,61,64,66,75,79,82,88,90,
%T 94,100,108,117,118,120,121,127,129,130,142,144,147,156,160,165,166,
%U 172,178,192,196,198,199,205,208,211,220,225,235,243,244,246,250,256,264,270,274,282,283,286,295,298
%N Nonnegative integers of the form 3x^2+3xy+4y^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(3,3,4,500);
%t Take[Union[3First[#]^2+3(Times@@#)+4Last[#]^2&/@Tuples[Range[-10,10],2]],70] (* _Harvey P. Dale_, Jul 25 2014 *)
%Y Primes: A106884.
%K nonn
%O 0,2
%A _N. J. A. Sloane_, Jun 08 2014
|