OFFSET
1,2
COMMENTS
If the equation x^2+y^2 = n has got two solutions (x, y), (y, x) then they will be counted only once.
No solutions can exist for the values of k > n.
This sequence differs from A216504, since this sequence gives the total number of solutions to the equation x^2+k*y^2 = n, whereas the sequence A216504 gives the number of distinct values of k for which a solution to the equation x^2+k*y^2 = n can exist.
Some values of k can clearly have more than one solution.
For example, x^2+k*y^2 = 33 is satisfiable for
33 = 1^2+2*4^2.
33 = 5^2+2*2^2.
33 = 3^2+6*2^2.
33 = 1^2+8*2^2.
33 = 5^2+8*1^2.
33 = 4^2+17*1^2.
33 = 3^2+24*1^2.
33 = 2^2+29*1^2.
33 = 1^2+32*1^2.
33 = 0^2+33*1^2.
So for this sequence a(33) = 10.
On the other hand, for A216504, there exist only 7 different values of k for which a solution to the equation mentioned above exists.
So A216504(33) = 8.
PROG
(PARI) for(n=1, 100, sol=0; for(k=1, n, for(x=0, 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++))); if(issquare(n), print1(0", "), print1(sol", "))) /* V. Raman, Oct 16 2012 */
CROSSREFS
Cf. A217840 (a variant of this sequence, when the order does matter for the equation x^2+y^2 = n, i.e. if the equation x^2+y^2 = n has got two solutions (x, y), (y, x) then they will be counted separately).
KEYWORD
nonn
AUTHOR
V. Raman, Sep 13 2012
EXTENSIONS
Ambiguity in name corrected by V. Raman, Oct 16 2012
STATUS
approved