login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A243653
Nonnegative integers of the form 3x^2+xy+4y^2.
2
0, 3, 4, 6, 8, 12, 14, 16, 17, 18, 21, 24, 27, 28, 32, 34, 36, 37, 42, 48, 49, 54, 56, 63, 64, 68, 71, 72, 74, 75, 79, 81, 84, 96, 98, 100, 101, 102, 103, 106, 108, 112, 118, 119, 122, 126, 128, 136, 141, 142, 144, 147, 148, 149, 150, 153, 158, 159, 162, 168, 177, 178, 183, 188, 189, 192, 194, 196
OFFSET
0,2
COMMENTS
Discriminant -47.
LINKS
N. J. A. Sloane et al., Binary Quadratic Forms and OEIS (Index to related sequences, programs, references)
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(3, 1, 4, 500);
# Alternative:
select(t -> nops([isolve(3*x^2+x*y+4*y^2=t)])>0, [$0..1000]); # Robert Israel, Jun 08 2014
MATHEMATICA
sol[t_] := Solve[3 x^2 + x y + 4 y^2 == t, {x, y}, Integers];
Select[Range[0, 1000], sol[#] != {}&] (* Jean-François Alcover, Jul 28 2020 *)
CROSSREFS
Primes: A106895.
Sequence in context: A167711 A037346 A250122 * A365168 A203444 A008864
KEYWORD
nonn
AUTHOR
N. J. A. Sloane, Jun 08 2014
STATUS
approved