login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A366091
a(n) is the number of ways to write n = i^2 + 2*j^2 + 3*k^2 with i,j,k >= 0.
3
1, 1, 1, 2, 2, 1, 2, 1, 1, 3, 0, 2, 4, 1, 2, 2, 2, 1, 3, 2, 2, 4, 2, 1, 2, 2, 0, 4, 3, 2, 5, 2, 1, 3, 2, 2, 7, 2, 2, 5, 0, 2, 0, 2, 4, 4, 3, 1, 4, 3, 3, 5, 3, 2, 7, 1, 2, 6, 0, 3, 6, 2, 2, 4, 2, 2, 6, 3, 2, 4, 3, 3, 3, 2, 0, 7, 5, 2, 6, 3, 2, 8, 2, 2, 11, 2, 5, 2, 2, 3, 0, 4, 3, 7, 3, 2, 2, 3, 3
OFFSET
0,4
LINKS
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
Cf. A028594 (allows any integer i,j,k), A055042 (a(n) = 0)
Sequence in context: A332278 A182596 A087775 * A089955 A352942 A180312
KEYWORD
nonn
AUTHOR
Robert Israel, Sep 28 2023
STATUS
approved