OFFSET
0,2
LINKS
Seiichi Manyama, Table of n, a(n) for n = 0..10000 (terms 0..2000 from T. D. Noe)
FORMULA
Coefficient of q^n in (1 + q + q^4 + q^9 + q^16 + q^25 + q^36 + q^49 + q^64 + ...)^8.
G.f.: (1 + theta_3(q))^8/256, where theta_3() is the Jacobi theta function. - Ilya Gutkovskiy, Aug 08 2018
MATHEMATICA
(1 + EllipticTheta[3, 0, q])^8/256 + O[q]^40 // CoefficientList[#, q]& (* Jean-François Alcover, Aug 26 2019 *)
PROG
(PARI) seq(n)=Vec((sum(k=0, sqrtint(n), x^(k^2)) + O(x*x^n))^8) \\ Andrew Howroyd, Aug 08 2018
(Ruby)
def mul(f_ary, b_ary, m)
s1, s2 = f_ary.size, b_ary.size
ary = Array.new(s1 + s2 - 1, 0)
(0..s1 - 1).each{|i|
(0..s2 - 1).each{|j|
ary[i + j] += f_ary[i] * b_ary[j]
}
}
ary[0..m]
end
def power(ary, n, m)
if n == 0
a = Array.new(m + 1, 0)
a[0] = 1
return a
end
k = power(ary, n >> 1, m)
k = mul(k, k, m)
return k if n & 1 == 0
return mul(k, ary, m)
end
def A(k, n)
ary = Array.new(n + 1, 0)
(0..Math.sqrt(n).to_i).each{|i| ary[i * i] = 1}
power(ary, k, n)
end
p A(8, 100) # Seiichi Manyama, May 28 2017
CROSSREFS
KEYWORD
nonn
AUTHOR
STATUS
approved