OFFSET
0,4
COMMENTS
Also the number of nonnegative integer solutions (a_1, a_2, ... , a_n) to the equation a_1^2 + 2*a_2^2 + ... + n*a_n^2 = n^2.
LINKS
Alois P. Heinz, Table of n, a(n) for n = 0..250 (first 101 terms from Seiichi Manyama)
FORMULA
a(n) = [x^(n^2)] Product_{k=1..n} (theta_3(x^k) + 1)/2, where theta_3() is the Jacobi theta function.
EXAMPLE
1*0^2 + 2*1^2 + 3*1^2 + 4*0^2 + 5*2^2 = 25.
1*0^2 + 2*2^2 + 3*2^2 + 4*0^2 + 5*1^2 = 25.
1*0^2 + 2*3^2 + 3*1^2 + 4*1^2 + 5*0^2 = 25.
1*1^2 + 2*0^2 + 3*0^2 + 4*1^2 + 5*2^2 = 25.
1*1^2 + 2*0^2 + 3*1^2 + 4*2^2 + 5*1^2 = 25.
1*1^2 + 2*2^2 + 3*0^2 + 4*2^2 + 5*0^2 = 25.
1*1^2 + 2*2^2 + 3*2^2 + 4*1^2 + 5*0^2 = 25.
1*2^2 + 2*0^2 + 3*0^2 + 4*2^2 + 5*1^2 = 25.
1*2^2 + 2*0^2 + 3*2^2 + 4*1^2 + 5*1^2 = 25.
1*2^2 + 2*1^2 + 3*1^2 + 4*2^2 + 5*0^2 = 25.
1*2^2 + 2*3^2 + 3*1^2 + 4*0^2 + 5*0^2 = 25.
1*3^2 + 2*0^2 + 3*0^2 + 4*2^2 + 5*0^2 = 25.
1*3^2 + 2*0^2 + 3*2^2 + 4*1^2 + 5*0^2 = 25.
1*3^2 + 2*2^2 + 3*1^2 + 4*0^2 + 5*1^2 = 25.
1*4^2 + 2*0^2 + 3*0^2 + 4*1^2 + 5*1^2 = 25.
1*4^2 + 2*1^2 + 3*1^2 + 4*1^2 + 5*0^2 = 25.
1*5^2 + 2*0^2 + 3*0^2 + 4*0^2 + 5*0^2 = 25.
So a(5) = 17.
MAPLE
b:= proc(n, i) option remember; local j; if n=0 then 1
elif i<1 then 0 else b(n, i-1); for j while
i*j^2<=n do %+b(n-i*j^2, i-1) od; % fi
end:
a:= n-> b(n^2, n):
seq(a(n), n=0..30); # Alois P. Heinz, Oct 28 2018
MATHEMATICA
nmax = 25; Table[SeriesCoefficient[Product[(EllipticTheta[3, 0, x^k] + 1)/2, {k, 1, n}], {x, 0, n^2}], {n, 0, nmax}] (* Vaclav Kotesovec, Oct 29 2018 *)
PROG
(PARI) {a(n) = polcoeff(prod(i=1, n, sum(j=0, sqrtint(n^2\i), x^(i*j^2)+x*O(x^(n^2)))), n^2)}
CROSSREFS
KEYWORD
nonn
AUTHOR
Seiichi Manyama, Oct 28 2018
STATUS
approved