%I #43 Sep 08 2022 08:45:37
%S 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,-1,
%T 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,0,0,
%U 0,0,0,0,0,-1,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-1,0,1,0,0,0,0,0
%N a(n) = 1 if n is a nonzero square, -1 if n is twice a nonzero square, 0 otherwise.
%C Ramanujan theta functions: f(q) (see A121373), phi(q) (A000122), psi(q) (A010054), chi(q) (A000700).
%H Antti Karttunen, <a href="/A143259/b143259.txt">Table of n, a(n) for n = 1..65537</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 1.
%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 = q * psi(q^4) * f(-q, -q^7) / f(-q^3, -q^5) in powers of q where phi(), psi() and f() are Ramanujan theta functions.
%F Expansion of q * f(-q, -q^7)^2 / psi(-q) in powers of q where psi(), f() are Ramanujan theta functions. - _Michael Somos_, Jan 01 2015
%F Euler transform of period 8 sequence [ -1, 0, 1, 1, 1, 0, -1, -1, ...].
%F a(2*n) = -a(n) for all n in Z.
%F a(n) is multiplicative with a(2^e) = (-1)^e, a(p^e) = (1 + (-1)^e) / 2 if p == 1 (mod 2).
%F Dirichlet g.f.: zeta(2*s) * (1 - 2^-s); Dirichlet convolution of A010052 and A154955.
%F G.f. A(x) satisfies: A(x) / A(x^2) = -1 + A111374(x).
%F G.f. A(x) satisfies: A(x^2) = - (A(x) + A(-x)) / 2.
%F G.f. A(x) satisfies: 0 = f(A(x), A(x^2), A(x^4)) where f(u, v, w) = w * (u + v)^2 - v * (v + w) * (v + 2*w).
%F G.f.: (theta_3(q) - theta_3(q^2)) / 2 = Sum_{k>0} x^(k^2) - x^(2k^2).
%F |a(n)| = A053866(n).
%F a(n) = A008836(n)*A053866(n). - _Jon Maiga_, Jan 11 2019
%F Sum_{k=1..n} a(k) ~ (1 - 1/sqrt(2)) * sqrt(n). - _Vaclav Kotesovec_, Oct 16 2020
%e G.f. = q - q^2 + q^4 - q^8 + q^9 + q^16 - q^18 + q^25 - q^32 + q^36 + q^49 - q^50 + ...
%t f[n_]:=Which[IntegerQ[Sqrt[n/2]],-1,IntegerQ[Sqrt[n]],1,True,0]; Array[f,110] (* _Harvey P. Dale_, Jul 07 2011 *)
%t a[ n_] := Boole[ IntegerQ[ Sqrt[n]]] - Boole[ IntegerQ[ Sqrt[2 n]]]; (* _Michael Somos_, Jun 10 2014 *)
%t a[ n_] := SeriesCoefficient[ (EllipticTheta[ 3, 0, q] - EllipticTheta[ 3, 0, q^2])/2, {q, 0, n}]; (* _Michael Somos_, Jun 10 2014 *)
%t Table[LiouvilleLambda[n]*Mod[DivisorSigma[1, n], 2], {n, 100}] (* _Jon Maiga_, Jan 11 2019 *)
%o (PARI) {a(n) = issquare(n) - issquare(2*n)};
%o (PARI) {a(n) = if( n<1, 0, n--; polcoeff( prod(k=1, n, (1 - x^k)^([1, 1, 0, -1, -1, -1, 0, 1][k%8 + 1]), 1 + x * O(x^n)), n))};
%o (Magma) Basis( ModularForms( Gamma1(8), 1/2), 100) [2] ; /* _Michael Somos_, Jun 10 2014 */
%Y Cf. A008836, A010052, A053866, A111374, A154955.
%K sign,mult
%O 1,1
%A _Michael Somos_, Aug 02 2008
|