%I #84 Oct 28 2023 04:04:32
%S 0,1,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,
%T 0,0,0,0,0,0,0,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,0,0,
%U 0,0,0,0,0,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,0,0,0,0,0,0,0
%N a(n) = 1 if n is an odd square, otherwise 0.
%C Motivated by expansion of Jacobi theta function theta_2(x) = Sum_{m = -oo..oo} x^((m+1/2)^2) = 2*Sum_{m odd > 0} q^(m^2/4).
%C a(n) for n >= 1 is also equal to the Ramanujan number A000594(n) read mod 2. This follows from a theorem started by V. Kumar Murty (2011). Thanks to _Benoit Cloitre_ for this reference. - _N. J. A. Sloane_, Aug 29 2017
%C The identification of this sequence with A000594 mod 2 was answered in Mathematics Stack Exchange question 71251. The idea is that (1 - q - q^2 + q^5 + q^7 - ...)^3 = 1 - 3*q + 5*q^3 - 7*q^6 + ... . Reduce mod 2 giving 1 + q + q^3 + q^6 + ... and using (x + y)^2 == (x^2 + y^2) (mod 2) three times gives (1 + q + q^3 + q^6 + ...)^8 == (1 + q^8 + q^24 + q^48 + ...) (mod 2) and we are done. - _Michael Somos_, Sep 12 2017
%D Louis Comtet, Advanced Combinatorics, Reidel, 1974, p. 104, [5n].
%D J. H. Conway and N. J. A. Sloane, "Sphere Packings, Lattices and Groups", Springer-Verlag, p. 102.
%D Nathan J. Fine, Basic Hypergeometric Series and Applications, Amer. Math. Soc., 1988; p. 93, Eq. (34.12).
%D E. T. Whittaker and G. N. Watson, A Course of Modern Analysis, Cambridge Univ. Press, 4th ed., 1963, p. 464.
%H Antti Karttunen, <a href="/A098108/b098108.txt">Table of n, a(n) for n = 0..65025</a>
%H Mathematics Stack Exchange, <a href="https://math.stackexchange.com/q/71251/#71341">Converting an infinite product to sum; Ramanujan tau function</a>.
%H V. Kumar Murty, <a href="http://home.iiserbhopal.ac.in/~kashyap/tau.pdf">The Tau of Ramanujan</a>, Slides of a talk given at the Indian Institute of Science Education and Research, Bhopal, India, Oct 10, 2011. See slide 63/95.
%H Ken Ono, Sinai Robins and Patrick T. Wahl, <a href="http://www.mathcs.emory.edu/~ono/publications-cv/pdfs/006.pdf">On the Representation of Integers as Sums of Triangular Numbers</a>, Aequationes mathematicae, August 1995, Volume 50, Issue 1-2, pp 73-94.
%H H. P. F. Swinnerton-Dyer, <a href="http://dx.doi.org/10.1007/978-3-540-37802-0_1">On l-adic representations and congruences for coefficients of modular forms</a>, pp. 1-55 of Modular Functions of One Variable III (Antwerp 1972), Lect. Notes Math., 350, 1973.
%H Eric Weisstein's World of Mathematics, <a href="http://mathworld.wolfram.com/JacobiThetaFunctions.html">Jacobi Theta Functions</a>.
%H <a href="/index/Ch#char_fns">Index entries for characteristic functions</a>.
%F Multiplicative with a(p^e) = 1 if 2 divides e and p > 2, 0 otherwise. - _Mitch Harris_, Jun 09 2005
%F Dirichlet g.f.: zeta(2*s)*(1-2^(-2*s)). - _R. J. Mathar_, Mar 10 2011
%F G.f.: theta_2( 0, q^4) / 2. - _Michael Somos_, Jun 08 2012
%F Euler transform of period 16 sequence [ 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, -1, ...]. - _Michael Somos_, Jun 08 2012
%F a(8*n + 1) = A010054(n). a(n) = 0 unless n == 1 (mod 8). - _Michael Somos_, Jun 08 2012
%F a(n) = A000035(n)*A010052(n). - _Michel Marcus_, Jun 09 2014
%F For n > 0, a(n) = floor( (sqrt(n)+1)/2 ) - floor( (sqrt(n-1)+1)/2 ). - _Mikael Aaltonen_, Mar 08 2015
%F G.f.: eta quotient eta(16*tau)^2/eta(8*tau) = q*Product_{n>=1} (1-q^(16*n))^2 / Product_{n>=1} (1-q^(8*n)), with q = exp(2*Pi*I*z), Im(z) > 0. See the Ono et al. reference, p. 4. - _Wolfdieter Lang_, Jan 11 2017
%F Sum_{k=1..n} a(k) ~ sqrt(n)/2. - _Amiram Eldar_, Oct 28 2023
%e G.f. = q + q^9 + q^25 + q^49 + q^81 + q^121 + q^169 + q^225 + q^289 + q^361 + ...
%p add(x^((m+1/2)^2),m=-10..10);
%p # alternative
%p A098108 := proc(n)
%p if issqr(n) and type(n,'odd') then
%p 1;
%p else
%p 0 ;
%p end if;
%p end proc:
%p seq(A098108(n),n=0..30) ; # _R. J. Mathar_, Feb 22 2021
%t Table[If[OddQ@ n && IntegerQ@ Sqrt[n], 1, 0], {n, 0, 120}] (* _Michael De Vlieger_, Mar 08 2015 *)
%t Array[Boole@ OddQ@ RamanujanTau@ # &, 120] (* _Michael De Vlieger_, Aug 27 2017 *)
%o (PARI) {a(n) = n%2 && issquare( n)}; /* _Michael Somos_, Jun 08 2012 */
%o (PARI) A126811(n) = (ramanujantau(n)%2); \\ _Antti Karttunen_, Aug 27 2017
%Y Cf. A000122 (theta_3), A002448 (theta_4).
%Y Cf. A000035, A010052, A016754, A000594, A010054.
%K nonn,easy,mult
%O 0,1
%A _N. J. A. Sloane_, Nov 03 2004