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!)
A218799 Number of solutions to x^2 + 2y^2 = n^2. 4
1, 1, 1, 2, 1, 1, 2, 1, 1, 3, 1, 2, 2, 1, 1, 2, 1, 2, 3, 2, 1, 2, 2, 1, 2, 1, 1, 4, 1, 1, 2, 1, 1, 5, 2, 1, 3, 1, 2, 2, 1, 2, 2, 2, 2, 3, 1, 1, 2, 1, 1, 5, 1, 1, 4, 2, 1, 5, 1, 2, 2, 1, 1, 3, 1, 1, 5, 2, 2, 2, 1, 1, 3, 2, 1, 2, 2, 2, 2, 1, 1, 5, 2, 2, 2, 2, 2, 2 (list; graph; refs; listen; history; text; internal format)
OFFSET
0,4
COMMENTS
a(3k) > 1 for all k > 0 because k^2 + 2(2k)^2 = (3k)^2.
Terms with index n^2 in A216282. - Joerg Arndt, Nov 06 2012
LINKS
EXAMPLE
a(9) = 3 because we have 9^2 + 2*0^2 = 9^2, 3^2 + 2*6^2 = 9^2 and 7^2 + 2*4^2 = 9^2 and no others.
MATHEMATICA
nn = 87; 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<100; i++) {
d=0; e=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)) d++;
if (Math.pow(a, 2)+2*Math.pow(b, 2)<=Math.pow(i, 2)) e++;
}
document.write((e-d)+", ");
}
CROSSREFS
Sequence in context: A320010 A210763 A281681 * A078770 A072038 A284315
KEYWORD
nonn
AUTHOR
Jon Perry, Nov 06 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 21:09 EDT 2024. Contains 371798 sequences. (Running on oeis4.)