A216672 Total number of solutions to the equation x^2 + k*y^2 = n with x > 0, y > 0, k > 0. (Order does not matter for the equation x^2 + y^2 = n.)
0, 1, 1, 1, 2, 2, 2, 3, 3, 3, 3, 4, 5, 3, 3, 4, 6, 5, 5, 6, 6, 5, 4, 6, 7, 5, 6, 8, 8, 5, 6, 8, 9, 7, 5, 9, 10, 6, 6, 10, 11, 6, 8, 9, 11, 7, 6, 10, 11, 8, 8, 14, 11, 10, 8, 10, 13, 9, 8, 10, 14, 7, 9, 12, 14, 9, 10, 14, 12, 10, 8, 15, 17, 9, 9, 16, 12, 8, 11
Offset: 1
Keywords
Links
- T. D. Noe, Table of n, a(n) for n = 1..1000
Crossrefs
Programs
-
Mathematica
nn = 100; t = Table[0, {nn}]; Do[n = x^2 + k*y^2; If[n <= nn && (k > 1 || k == 1 && x <= y), t[[n]]++], {x, Sqrt[nn]}, {y, Sqrt[nn]}, {k, nn}] (* T. D. Noe, Sep 20 2012 *)
-
PARI
for(n=1, 100, sol=0; for(k=1, n, for(x=1, n, if((issquare(n-k*x*x)&&n-k*x*x>0&&k>=2)||(issquare(n-x*x)&&n-x*x>0&&k==1&&x*x<=n-x*x), sol++))); print1(sol", ")) /* V. Raman, Oct 16 2012 */
Extensions
Ambiguity in name corrected by V. Raman, Oct 16 2012
Comments