# Greetings from The On-Line Encyclopedia of Integer Sequences! http://oeis.org/ Search: id:a008442 Showing 1-1 of 1 %I A008442 #44 May 17 2023 10:24:24 %S A008442 1,0,0,0,2,0,0,0,1,0,0,0,2,0,0,0,2,0,0,0,0,0,0,0,3,0,0,0,2,0,0,0,0,0, %T A008442 0,0,2,0,0,0,2,0,0,0,2,0,0,0,1,0,0,0,2,0,0,0,0,0,0,0,2,0,0,0,4,0,0,0, %U A008442 0,0,0,0,2,0,0,0,0,0,0,0,1,0,0,0,4,0,0,0,2,0,0,0,0,0,0,0,2,0,0,0,2,0,0,0,0 %N A008442 Expansion of Jacobi theta constant (theta_2(2z))^2/4. %C A008442 Ramanujan theta functions: f(q) (see A121373), phi(q) (A000122), psi(q) (A010054), chi(q) (A000700). %C A008442 a(n) is the number of ways of writing 2n as the sum of two odd positive squares. (Cf. A290081 & A008441). - _Antti Karttunen_, Jul 24 2017 %D A008442 J. H. Conway and N. J. A. Sloane, "Sphere Packings, Lattices and Groups", Springer-Verlag, p. 102. %D A008442 Nathan J. Fine, Basic Hypergeometric Series and Applications, Amer. Math. Soc., 1988; p. 78, Eq. (32.26). %H A008442 T. D. Noe, Table of n, a(n) for n = 1..1000 %H A008442 Michael Somos, Introduction to Ramanujan theta functions. %H A008442 Eric Weisstein's World of Mathematics, Ramanujan Theta Functions. %F A008442 Fine gives an explicit formula for a(n) in terms of the divisors of n. %F A008442 a(n) = number of divisors of n of form 8n+1, 8n+5, 8n+6 minus number of divisors of form 8n+2, 8n+3, 8n+7. [I think Fine's version is simpler - _N. J. A. Sloane_] %F A008442 G.f.: s(8)^4/(s(4)^2), where s(k) := subs(q=q^k, eta(q)), where eta(q) is Dedekind's function, cf. A010815. [Fine] %F A008442 Expansion of q * psi(q^4)^2 in powers of q where psi() is a Ramanujan theta function. - _Michael Somos_, Feb 22 2015 %F A008442 Expansion of eta(q^8)^4 / eta(q^4)^2 in powers of q. %F A008442 Euler transform of period 8 sequence [ 0, 0, 0, 2, 0, 0, 0, -2, ...]. - _Michael Somos_, Apr 24 2004 %F A008442 a(n)=0 unless n=4k+1 in which case a(n) is the difference between number of divisors of n of form 4k+1 and 4k+3. %F A008442 Multiplicative with a(2^e) = 0^e, a(p^e) = (1 + (-1)^e)/2 if p==3 mod 4 otherwise a(p^e) = 1+e. - _Michael Somos_, Sep 18 2004 %F A008442 Moebius transform is period 8 sequence [ 1, -1, -1, 0, 1, 1, -1, 0, ...]. - _Michael Somos_, Sep 02 2005 %F A008442 G.f.: Sum_{k>0} Kronecker(-4, k) * x^k / (1 - x^(2*k)) = Sum_{k>0} x^(2*k - 1) / (1 + x^(4*k - 2)). - _Michael Somos_, Sep 20 2005 %F A008442 G.f.: Sum_{k>0} x^k * (1 - x^k) * (1 - x^(2*k)) * (1 - x^(3*k)) / (1 - x^(8*k)) = x Product_{k>0} (1 - x^(8*k))^4 / (1 - x^(4*k))^2. - _Michael Somos_, Apr 24 2004 %F A008442 a(4*n + 1) = A008441(n). %F A008442 Asymptotic mean: Limit_{m->oo} (1/m) * Sum_{k=1..m} a(k) = Pi/8 = 0.392699... (A019675). - _Amiram Eldar_, Oct 23 2022 %e A008442 G.f. = q + 2*q^5 + q^9 + 2*q^13 + 2*q^17 + 3*q^25 + 2*q^29 + 2*q^37 + ... %t A008442 a[n_] := Sum[{0, 1, -1, -1, 0, 1, 1, -1}[[Mod[d, 8] + 1]], {d, Divisors[n]}]; Table[a[n], {n, 1, 105}] (* _Jean-François Alcover_, May 15 2013, after _Michael Somos_ *) %t A008442 a[ n_] := SeriesCoefficient[ EllipticTheta[ 2, 0, x^2]^2 / 4, {x, 0, n}]; (* _Michael Somos_, Feb 22 2015 *) %t A008442 a[ n_] := If[ n < 1 || Mod[n, 4] != 1, 0, Sum[ KroneckerSymbol[ 4, d], {d, Divisors @n}]]; (* _Michael Somos_, Feb 22 2015 *) %o A008442 (PARI) {a(n) = if( n<1 || n%4!=1, 0, sumdiv(n, d, (d%4==1) - (d%4==3)))}; /* _Michael Somos_, Apr 24 2004 */ %o A008442 (PARI) {a(n) = if( n<1, 0, sumdiv(n, d, [0, 1, -1, -1, 0, 1, 1, -1][d%8+1]))}; /* _Michael Somos_, Apr 24 2004 */ %o A008442 (PARI) {a(n) = local(A); if( n<1, 0, n--; A = x * O(x^n); polcoeff( eta(x^8 + A)^4 / eta(x^4 + A)^2, n))}; /* _Michael Somos_, Apr 24 2004 */ %o A008442 (Magma) A := Basis( ModularForms( Gamma1(16), 1), 106); A[2] + 2*A[6]; /* _Michael Somos_, Feb 22 2015 */ %o A008442 (Python) %o A008442 from sympy import divisors %o A008442 def A008442(n): return 0 if n&3!=1 else sum(((a:=d&3)==1)-(a==3) for d in divisors(n,generator=True)) # _Chai Wah Wu_, May 17 2023 %Y A008442 Cf. A008441, A019675. %Y A008442 Even bisection of A290081. %K A008442 nonn,mult %O A008442 1,5 %A A008442 _N. J. A. Sloane_ # Content is available under The OEIS End-User License Agreement: http://oeis.org/LICENSE