This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A218799 #13 Mar 11 2014 01:53:49 %S A218799 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, %T A218799 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, %U A218799 2,2,1,1,3,2,1,2,2,2,2,1,1,5,2,2,2,2,2,2 %N A218799 Number of solutions to x^2 + 2y^2 = n^2. %C A218799 a(3k) > 1 for all k > 0 because k^2 + 2(2k)^2 = (3k)^2. %C A218799 Terms with index n^2 in A216282. - _Joerg Arndt_, Nov 06 2012 %e A218799 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. %t A218799 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 *) %o A218799 (JavaScript) %o A218799 for (i=0;i<100;i++) { %o A218799 d=0;e=0; %o A218799 for (a=0;a<=i;a++) %o A218799 for (b=0;b<=i;b++) { %o A218799 if (Math.pow(a,2)+2*Math.pow(b,2)<Math.pow(i,2)) d++; %o A218799 if (Math.pow(a,2)+2*Math.pow(b,2)<=Math.pow(i,2)) e++; %o A218799 } %o A218799 document.write((e-d)+", "); %o A218799 } %Y A218799 Cf. A218706, A218800. %K A218799 nonn %O A218799 0,4 %A A218799 _Jon Perry_, Nov 06 2012