OFFSET
0,2
EXAMPLE
There are 5 solutions for n=2, namely (0,0), (0,1), (1,1), (1,0) and (2,0), so a(2) = 5.
MATHEMATICA
nn = 50; t = Sort[Select[Flatten[Table[x^2 + 2*y^2, {x, 0, nn}, {y, 0, nn}]], # <= nn^2 &]]; Table[Count[t, _?(# <= n^2 &)], {n, 0, nn}] (* T. D. Noe, Nov 06 2012 *)
PROG
(JavaScript)
for (i=0; i<50; i++) {
c=0;
for (a=0; a<=i; a++)
for (b=0; b<=i; b++)
if (Math.pow(a, 2)+2*Math.pow(b, 2)<=Math.pow(i, 2)) c++;
document.write(c+", ");
}
CROSSREFS
KEYWORD
nonn
AUTHOR
Jon Perry, Nov 04 2012
STATUS
approved