OFFSET
0,1
COMMENTS
LINKS
G. C. Greubel, Table of n, a(n) for n = 0..1000
S. Cooper and M. Hirschhorn, On some infinite product identities, Rocky Mountain J. Math., 31 (2001) 131-139. See p. 133 Theorem 3.
Michael Somos, Introduction to Ramanujan theta functions
Eric Weisstein's World of Mathematics, Ramanujan Theta Functions
FORMULA
Euler transform of period 12 sequence [1, -1, 1, 0, 0, -1, 0, 0, 1, -1, 1, -1, ...].
Expansion of psi(q^3) * f(-q^2, -q^10) / f(-q, -q^11) in powers of q where psi(), is a Ramanujan theta function and f(, ) is Ramanujan's general theta function.
Multiplicative with a(0) = a(3^e) = 1, a(p^e) = 1 if e even, 0 otherwise.
G.f.: (theta_3(q) + theta_3(q^3)) / 2 = 1 + (Sum_{k>0} x^(k^2) + x^(3*k^2)).
Dirichlet g.f.: zeta(2*s) * (1 + 3^-s).
a(n) = A145377(n) unless n=0. a(3*n + 2) = 0. a(2*n + 1) = A127692(n). a(3*n) = a(n). a(3*n + 1) = A089801(n).
Sum_{k=0..n} a(k) ~ (1+1/sqrt(3)) * sqrt(n). - Amiram Eldar, Sep 14 2023
EXAMPLE
G.f. = 1 + q + q^3 + q^4 + q^9 + q^12 + q^16 + q^25 + q^27 + q^36 + q^48 + ...
MATHEMATICA
a[ n_] := SeriesCoefficient[ Series[ (EllipticTheta[ 3, 0, q] + EllipticTheta[ 3, 0, q^3]) / 2, {q, 0, n}], {q, 0, n}];
a[ n_] := If[ n < 0, 0, Boole[ OddQ [ Length @ Divisors @ n] || OddQ [ Length @ Divisors[3 n]]]];
Table[If[AnyTrue[{Sqrt[n], Sqrt[3n]}, IntegerQ], 1, 0], {n, 0, 110}] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, May 22 2020 *)
PROG
(PARI) {a(n) = issquare(n) || issquare(3*n)};
(PARI) {a(n) = if( n<1, n==0, direuler( p=2, n, if( p==3, 1 + X, 1) / (1 - X^2))[n])};
CROSSREFS
KEYWORD
nonn,mult,easy
AUTHOR
Michael Somos, Sep 11 2011
STATUS
approved