login
a(n) = 1 if n is one or two times an even square, -1 if one or two times an odd square else 0.
1

%I #13 Mar 12 2021 22:24:46

%S 1,-1,-1,0,1,0,0,0,1,-1,0,0,0,0,0,0,1,0,-1,0,0,0,0,0,0,-1,0,0,0,0,0,0,

%T 1,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,-1,-1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,

%U 0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,-1,0,0

%N a(n) = 1 if n is one or two times an even square, -1 if one or two times an odd square else 0.

%C Ramanujan theta functions: f(q) (see A121373), phi(q) (A000122), psi(q) (A010054), chi(q) (A000700).

%H G. C. Greubel, <a href="/A214507/b214507.txt">Table of n, a(n) for n = 0..1000</a>

%H S. Cooper and M. Hirschhorn, <a href="http://dx.doi.org/10.1216/rmjm/1008959672">On some infinite product identities</a>, Rocky Mountain J. Math., 31 (2001) 131-139. see p. 133 Theorem 2.

%H Michael Somos, <a href="/A010815/a010815.txt">Introduction to Ramanujan theta functions</a>

%H Eric Weisstein's World of Mathematics, <a href="http://mathworld.wolfram.com/RamanujanThetaFunctions.html">Ramanujan Theta Functions</a>

%F Expansion of (phi(-q) + phi(-q^2)) / 2 in powers of q where phi() is a Ramanujan theta function.

%F Expansion of f(-x^2, -x^2) * f(x^6, x^10) / f(x, x^3) in powers of x where f() is Ramanujan's two-variable theta function.

%F a(n) = - b(n) where b(n) is multiplicative with b(2) = 1, b(2^e) = -1 if e>1, b(p^e) = (1 + (-1)^e) / 2 if p>2.

%F Euler transform of period 32 sequence [ -1, -1, -1, 0, -1, 0, -1, 0, -1, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, -1, 0, -1, 0, -1, 0, -1, -1, -1, -1, ...].

%F G.f.: (theta_4(q) + theta_4(q^2)) / 2 = 1 + (Sum_{k>0} (-1)^k * (x^(k^2) + x^(2*k^2))).

%F a(n) = (-1)^(n * (n + 1)/2) * A093709(n).

%e 1 - q - q^2 + q^4 + q^8 - q^9 + q^16 - q^18 - q^25 + q^32 + q^36 - q^49 + ...

%t a[ n_] := SeriesCoefficient[ (EllipticTheta[ 4, 0, q] + EllipticTheta[ 4, 0, q^2]) / 2, {q, 0, n}]

%t a[ n_] := If[ n < 0, 0, (-1)^(n (n + 1)/2) Boole[ OddQ[ Length @ Divisors[ n]] || OddQ[ Length @ Divisors[ 2 n]]]]

%o (PARI) {a(n) = (-1)^(n * (n + 1)/2) * (issquare(n) || issquare(2*n))}

%Y Cf. A093709.

%K sign

%O 0,1

%A _Michael Somos_, Jul 19 2012