OFFSET
0,5
LINKS
Alois P. Heinz, Table of n, a(n) for n = 0..1000
FORMULA
Coefficient of x^(n^2) in the series expansion of Product_{k=1..floor(sqrt(n))} 1/(1 - x^(k^2)). - Vladeta Jovovic, Mar 24 2004
EXAMPLE
n=6: 6^2 = 9*2^2 = 8*2^2+4*1^2 = 7*2^2+8*1^2 = 6*2^2+12*1^2 = 5*2^2+16*1^2 = 4*2^2+20*1^2 = 3*2^2+24*1^2 = 2*2^2+28*1^2 = 1*2^2+32*1^2 = 36*1^2, therefore a(6)=10.
MAPLE
b:= proc(n, i) option remember; `if`(n=0, 1,
`if`(i<1, 0, b(n, i-1) +`if`(i^2>n, 0, b(n-i^2, i))))
end:
a:= proc(n) local r; r:= isqrt(n);
b(n^2, r-`if`(r^2>n, 1, 0))
end:
seq(a(n), n=0..50); # Alois P. Heinz, Apr 15 2013
MATHEMATICA
b[n_, i_] := b[n, i] = If[n==0, 1, If[i<1, 0, b[n, i-1] + If[i^2 > n, 0, b[n-i^2, i]]]]; a[n_] := (r = Sqrt[n] // Floor; b[n^2, r - If[r^2 > n, 1, 0]]); Table[a[n], {n, 0, 50}] (* Jean-François Alcover, Jul 29 2015, after Alois P. Heinz *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Reinhard Zumkeller, Mar 21 2004
EXTENSIONS
More terms from Vladeta Jovovic, Mar 24 2004
Corrected a(0) by Alois P. Heinz, Apr 15 2013
STATUS
approved