login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A218706 Number of nonnegative integer solutions to x^2 + 2y^2 <= n^2. 1
1, 2, 5, 9, 12, 19, 27, 33, 42, 54, 66, 77, 91, 105, 120, 138, 156, 175, 197, 218, 240, 263, 287, 314, 339, 367, 398, 430, 459, 493, 526, 556, 595, 637, 670, 709, 752, 794, 833, 878, 921, 965, 1018, 1065, 1112, 1163, 1215, 1266, 1317, 1370, 1433, 1492, 1544 (list; graph; refs; listen; history; text; internal format)
OFFSET
0,2
LINKS
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
Sequence in context: A239876 A070828 A112988 * A270950 A139405 A360899
KEYWORD
nonn
AUTHOR
Jon Perry, Nov 04 2012
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 19 06:44 EDT 2024. Contains 371782 sequences. (Running on oeis4.)