OFFSET
0,4
LINKS
Robert Israel, Table of n, a(n) for n = 0..10000
FORMULA
G.f. (1 + theta_3(0,z)) * (1 + theta_3(0,z^2)) * (1 + theta_3(0,z^3))/8 where theta_3 is a Jacobi theta function.
EXAMPLE
a(9) = 3 because 9 = 3^2 + 2*0^2 + 3*0^2 = 1^2 + 2*2^2 + 3*0^2 = 2^2 + 2*1^2 + 3*1^2.
MAPLE
g:= (1+JacobiTheta3(0, z))*(1+JacobiTheta3(0, z^2))*(1+JacobiTheta3(0, z^3))/8:
S:= series(g, z, 101):
seq(coeff(S, z, j), j=0..100);
PROG
(Python)
from itertools import count
from sympy.ntheory.primetest import is_square
def A366091(n):
c = 0
for k in count(0):
if (a:=3*k**2)>n:
break
for j in count(0):
if (b:=a+(j**2<<1))>n:
break
if is_square(n-b):
c += 1
return c # Chai Wah Wu, Sep 29 2023
CROSSREFS
KEYWORD
nonn
AUTHOR
Robert Israel, Sep 28 2023
STATUS
approved