%I M0091 N0028 #120 Jul 31 2024 01:48:45
%S 1,-2,-1,2,1,2,-2,0,-2,-2,1,0,0,2,3,-2,2,0,0,-2,-2,0,0,-2,-1,0,2,2,-2,
%T 2,1,2,0,2,-2,-2,2,0,-2,0,-4,0,0,0,1,-2,0,0,2,0,2,2,1,-2,0,2,2,0,0,-2,
%U 0,-2,0,-2,2,0,-4,0,0,-2,-1,2,0,2,0,0,0,-2
%N Expansion of Product_{k>=1} (1 - x^k)^2.
%C Number of partitions of n into an even number of distinct parts minus number of partitions of n into an odd number of distinct parts, with 2 types of each part. E.g., for n=4, we consider k and k* to be different versions of k and so we have 4, 4*, 31, 31*, 3*1, 3*1*, 22*, 211*, 2*11*. The even partitions number 5 and the odd partitions number 4, so a(4)=5-4=1. - _Jon Perry_, Apr 04 2004
%C Also, number of partitions of n into parts of -2 different kinds (based upon formal analogy). - Michele Dondi (blazar(AT)lcm.mi.infn.it), Jun 29 2004
%C Ramanujan theta functions: f(q) (see A121373), phi(q) (A000122), psi(q) (A010054), chi(q) (A000700).
%C Number 68 of the 74 eta-quotients listed in Table I of Martin (1996).
%D N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
%D N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
%H Seiichi Manyama, <a href="/A002107/b002107.txt">Table of n, a(n) for n = 0..10000</a> (first 1001 terms from T. D. Noe)
%H G. E. Andrews, <a href="http://www.jstor.org/stable/2322623">Advanced problems 6562</a>, Amer. Math. Monthly 94, 1987.
%H M. Boylan, <a href="http://dx.doi.org/10.1016/S0022-314X(02)00037-9">Exceptional congruences for the coefficients of certain eta-product newforms</a>, J. Number Theory 98 (2003), no. 2, 377-389. MR1955423 (2003k:11071)
%H S. Cooper, M. D. Hirschhorn and R. Lewis, <a href="https://doi.org/10.1023/A:1009827103485">Powers of Euler's Product and Related Identities</a>, The Ramanujan Journal, Vol. 4 (2), 137-155 (2000).
%H S. R. Finch, <a href="https://arxiv.org/abs/math/0701251">Powers of Euler's q-Series</a>, arXiv:math/0701251 [math.NT], 2007.
%H J. W. L. Glaisher, <a href="https://doi.org/10.1112/plms/s1-21.1.182">On the square of Euler's series</a>, Proc. London Math. Soc., 21 (1889), 182-194.
%H J. T. Joichi, <a href="http://dx.doi.org/10.1016/0012-365X(90)90131-Z">Hecke-Rogers, Andrews identities; combinatorial proofs</a>, Discrete Mathematics, Vol. 84, Issue 3, 1990, pp. 255-259.
%H Victor G. Kac and Dale H. Peterson, <a href="http://dx.doi.org/10.1016/0001-8708(84)90032-X">Infinite-Dimensional Lie Algebras, Theta Functions and Modular Forms</a>, Advances in Mathematics (1984), 53. 125-264, see page 261, (5.19).
%H Martin Klazar, <a href="http://arxiv.org/abs/1808.08449">What is an answer? — remarks, results and problems on PIO formulas in combinatorial enumeration, part I</a>, arXiv:1808.08449 [math.CO], 2018.
%H M. Koike, <a href="http://projecteuclid.org/euclid.nmj/1118787564">On McKay's conjecture</a>, Nagoya Math. J., 95 (1984), 85-89.
%H V. Kotesovec, <a href="http://oeis.org/A258232/a258232_2.pdf">The integration of q-series</a>
%H Y. Martin, <a href="http://dx.doi.org/10.1090/S0002-9947-96-01743-6">Multiplicative eta-quotients</a>, Trans. Amer. Math. Soc. 348 (1996), no. 12, 4825-4856, see page 4852 Table I.
%H Tim Silverman, <a href="http://arxiv.org/abs/1612.08085">Counting Cliques in Finite Distant Graphs</a>, arXiv preprint arXiv:1612.08085 [math.CO], 2016.
%H Michael Somos, <a href="/A030203/a030203.txt">Index to Yves Martin's list of 74 multiplicative eta-quotients and their A-numbers</a>
%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>
%H <a href="/index/Pro#1mxtok">Index entries for expansions of Product_{k >= 1} (1-x^k)^m</a>
%F Expansion of q^(-1/12) * eta(q)^2 in powers of q. - _Michael Somos_, Mar 06 2012
%F Euler transform of period 1 sequence [ -2, ...]. - _Michael Somos_, Mar 06 2012
%F a(n) = b(12*n + 1) where b(n) is multiplicative and b(2^e) = b(3^e) = 0^e, b(p^e) = (1 + (-1)^e) / 2 if p == 7, 11 (mod 12), b(p^e) = (-1)^(e/2) * (1 + (-1)^e) / 2 if p == 5 (mod 12), b(p^e) = (e + 1) * (-1)^(e*x) if p == 1 (mod 12) where p = x^2 + 9*y^2. - _Michael Somos_, Sep 16 2006
%F Convolution inverse of A000712.
%F a(0) = 1, a(n) = -(2/n)*Sum{k = 0..n-1} a(k)*sigma_1(n-k). - _Joerg Arndt_, Feb 05 2011
%F Expansion of f(-x)^2 in powers of x where f() is a Ramanujan theta function. - _Michael Somos_, May 17 2015
%F G.f. is a period 1 Fourier series which satisfies f(-1 / (144 t)) = 12 (t/i) f(t) where q = exp(2 Pi i t). - _Michael Somos_, May 17 2015
%F a(n) = Sum_{k=0..n} A010815(k)*A010815(n-k); self convolution of A010815. - _Gevorg Hmayakyan_, Sep 18 2016
%F G.f.: Sum_{m, n in Z, n >= 2*|m|} (-1)^n * x^((3*(2*n + 1)^2 - (6*m + 1)^2)/24). - _Seiichi Manyama_, Oct 01 2016
%F G.f.: exp(-2*Sum_{k>=1} x^k/(k*(1 - x^k))). - _Ilya Gutkovskiy_, Feb 05 2018
%F From _Peter Bala_, Jan 02 2021: (Start)
%F For prime p congruent to 5, 7 or 11 (mod 12), a(n*p^2 + (p^2 - 1)/12) = e*a(n), where e = 1 if p == 7 or 11 (mod 12) and e = -1 if p == 5 (mod 12).
%F If n and p are coprime then a(n*p + (p^2 - 1)/12) = 0. See Cooper et al., Theorem 1. (End)
%F With the convention that a(n) = 0 for n < 0 we have the recurrence a(n) = A010816(n) + Sum_{k a nonzero integer} (-1)^(k+1)*a(n - k*(3*k-1)/2), where A010816(n) = (-1)^m*(2*m+1) if n = m*(m + 1)/2, with m positive, is a triangular number else equals 0. For example, n = 10 = (4*5)/2 is a triangular number, A010816(10) = 9, and so a(10) = 9 + a(9) + a(8) - a(5) - a(3) = 9 - 2 - 2 - 2 - 2 = 1. - _Peter Bala_, Apr 06 2022
%e G.f. = 1 - 2*x - x^2 + 2*x^3 + x^4 + 2*x^5 - 2*x^6 - 2*x^8 - 2*x^9 + x^10 + ...
%e G.f. = q - 2*q^13 - q^25 + 2*q^37 + q^49 + 2*q^61 - 2*q^73 - 2*q^97 - 2*q^109 + ...
%p A010816 := proc (n); if frac(sqrt(8*n+1)) = 0 then (-1)^((1/2)*isqrt(8*n+1)-1/2)*isqrt(8*n+1) else 0 end if; end proc:
%p N := 10:
%p a := proc (n) option remember; if n < 0 then 0 else A010816(n) + add( (-1)^(k+1)*a(n - (1/2)*k*(3*k-1) ), k = -N..-1) + add( (-1)^(k+1)*a(n - (1/2)*k*(3*k-1) ), k = 1..N) end if; end proc:
%p seq(a(n), n = 0..100); # _Peter Bala_, Apr 06 2022
%t terms = 78; Clear[s]; s[n_] := s[n] = Product[(1 - x^k)^2, {k, 1, n}] // Expand // CoefficientList[#, x]& // Take[#, terms]&; s[n = 10]; s[n = 2*n]; While[s[n] != s[n - 1], n = 2*n]; A002107 = s[n] (* _Jean-François Alcover_, Jan 17 2013 *)
%t a[ n_] := SeriesCoefficient[ QPochhammer[ x]^2, {x, 0, n}]; (* _Michael Somos_, Jan 31 2015 *)
%t a[ n_] := SeriesCoefficient[ Product[ 1 - x^k, {k, n}]^2, {x, 0, n}]; (* _Michael Somos_, Jan 31 2015 *)
%o (PARI) {a(n) = my(A, p, e, x); if( n<0, 0, n = 12*n + 1; A = factor(n); prod( k=1, matsize(A)[1], [p, e] = A[k,]; if( p<5, 0, p%12>1, if( e%2, 0, (-1)^((p%12==5) * e/2)), for( i=1, sqrtint(p\9), if( issquare(p - 9*i^2), x=i; break)); (e + 1) * (-1)^(e*x))))}; /* _Michael Somos_, Aug 30 2006 */
%o (PARI) {a(n) = if( n<0, 0, polcoeff( eta(x + x * O(x^n))^2, n))}; /* _Michael Somos_, Aug 30 2006 */
%o (PARI) Vec(eta(x)^2) \\ _Charles R Greathouse IV_, Apr 22 2016
%o (Magma) Basis( CuspForms( Gamma1(144), 1), 926) [1]; /* _Michael Somos_, May 17 2015 */
%o (Julia) # DedekindEta is defined in A000594.
%o A002107List(len) = DedekindEta(len, 2)
%o A002107List(78) |> println # _Peter Luschny_, Mar 09 2018
%Y Cf. A000712 (reciprocal of g.f.), A010815, A010816, A258406.
%Y Powers of Euler's product: A000594, A000727 - A000731, A000735, A000739, A010815 - A010840.
%K sign,nice
%O 0,2
%A _N. J. A. Sloane_