A217840 Total number of solutions to the equation x^2 + k*y^2 = n with x >= 0, y >= 0, k > 0, or 0 if the number is infinite. Order matters for the equation x^2 + y^2 = n.
0, 2, 2, 0, 4, 3, 3, 5, 0, 5, 4, 6, 7, 4, 4, 0, 8, 7, 6, 9, 7, 6, 5, 8, 0, 7, 8, 10, 10, 6, 7, 11, 10, 9, 6, 0, 12, 7, 7, 13, 13, 7, 9, 11, 14, 8, 7, 13, 0, 11, 9, 17, 13, 12, 9, 12, 14, 11, 9, 12, 16, 8, 11, 0, 17, 10, 11, 17, 13, 11, 9, 19, 19, 11, 11, 18, 13, 9, 12, 18, 0, 13, 10, 18, 20, 11, 10, 18, 19, 15, 13, 15, 15, 12, 10, 18, 22, 12, 16, 0
Offset: 1
Keywords
Links
- Andrew Howroyd, Table of n, a(n) for n = 1..1000
Crossrefs
Programs
-
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), sol++))); if(issquare(n),print1(0", "),print1(sol", "))) /* V. Raman, Oct 16 2012 */
Formula
a(n) = 0 if n is a square, otherwise a(n) = Sum_{k = 0..sqrt(n)} A046951(n-k^2). - Charlie Neder, Jan 15 2019
Comments