login
Excess of number of divisors of 2n+1 of form 8k+1, 8k+3 over those of form 8k+5, 8k+7.
15

%I #38 Dec 28 2023 01:52:08

%S 1,2,0,0,3,2,0,0,2,2,0,0,1,4,0,0,4,0,0,0,2,2,0,0,1,4,0,0,4,2,0,0,0,2,

%T 0,0,2,2,0,0,5,2,0,0,2,0,0,0,2,6,0,0,0,2,0,0,2,0,0,0,3,4,0,0,4,2,0,0,

%U 2,2,0,0,0,2,0,0,6,0,0,0,0,2,0,0,1,6,0,0,4,2,0,0,0,4,0,0,2,0,0,0,4,0,0,0,4

%N Excess of number of divisors of 2n+1 of form 8k+1, 8k+3 over those of form 8k+5, 8k+7.

%C Ramanujan theta functions: f(q) := Prod_{k>=1} (1-(-q)^k) (see A121373), phi(q) := theta_3(q) := Sum_{k=-oo..oo} q^(k^2) (A000122), psi(q) := Sum_{k=0..oo} q^(k*(k+1)/2) (A010054), chi(q) := Prod_{k>=0} (1+q^(2k+1)) (A000700).

%C Bisection of A002325. Number of ways to write n as a sum of a square plus four times a triangular number [Hirschhorn]. - _R. J. Mathar_, Mar 23 2011

%D Nathan J. Fine, Basic Hypergeometric Series and Applications, Amer. Math. Soc., 1988; p. 82, Eq. (32.55).

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

%H Michael D. Hirschhorn, <a href="http://dx.doi.org/10.1016/j.disc.2004.08.045">The number of representations of a number by various forms</a>, Discrete Mathematics 298 (2005), 205-211.

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

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

%F Expansion of phi(q) * psi(q^4) in powers of q where psi(), phi() are Ramanujan theta functions.

%F Expansion of q^(-1) * (eta(q^4)^5 * eta(q^16)^2) / (eta(q^2)^2 * eta(q^8)^3) in powers of q^2.

%F a(n) = b(2*n + 1) where b(n) is multiplicative and b(2^e) = 0^e, b(p^e) = e+1 if p == 1, 3 (mod 8), b(p^e) = (1+(-1)^e)/2 if p == 5, 7 (mod 8).

%F Euler transform of period 8 sequence [ 2, -3, 2, 0, 2, -3, 2, -2, ...].

%F G.f. is a period 1 Fourier series which satisfies f(-1 / (16 t)) = 2^(1/2) (t/i) g(t) where q = exp(2 Pi i t) and g() is g.f. for A133692. - _Michael Somos_, Mar 16 2011

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

%F G.f.: Sum_{k>=0} a(k) * x^(2*k + 1) = Sum_{k>=0} F(x^(2*k + 1), x^(3*(2*k + 1))) where F(x, y) = (x + y) / (1 + x*y).

%F a(4*n + 2) = a(4*n + 3) = 0. a(4*n) = A112603(n). a(4*n + 1) = 2 * A033761(n).

%F From _Peter Bala_, Jan 07 2021: (Start)

%F Conjectural g.f.s: A(x) = Sum_{n >= 0} (-1)^(n*(n-1)/2)*x^n/(1 - x^(2*n+1)).

%F A(x) = Sum_{n = -oo..oo} (-1)^n*x^(2*n)/(1 - x^(4*n+1)) = Sum_{n = -oo..oo} (-1)^n*x^(2*n+1)/(1 - x^(4*n+3)). (End)

%F Asymptotic mean: Limit_{m->oo} (1/m) * Sum_{k=1..m} a(k) = Pi/(2*sqrt(2)) = 1.1107207... (A093954). - _Amiram Eldar_, Dec 28 2023

%e 1 + 2*x + 3*x^4 + 2*x^5 + 2*x^8 + 2*x^9 + x^12 + 4*x^13 + 4*x^16 + ...

%e q + 2*q^3 + 3*q^9 + 2*q^11 + 2*q^17 + 2*q^19 + q^25 + 4*q^27 + 4*q^33 + ...

%t a[n_] := DivisorSum[2n+1, Switch[Mod[#, 8], 1|3, 1, 5|7, -1]&]; Table[a[n], {n, 0, 104}] (* _Jean-François Alcover_, Dec 04 2015 *)

%o (PARI) a(n) = if( n<0, 0, n = 2*n + 1; sumdiv(n, d, (-1)^(d%8>3)))

%o (PARI) a(n) = local(n1); if( n<0, 0, n1 = sqrtint(n); polcoeff( sum(k=1,n1, 2*x^k^2, 1 + x*O(x^n)) * sum(k=0,n1, x^(2*k^2 + 2*k)), n))

%o (PARI) a(n) = local(A); if( n<0, 0, A = x * O(x^n); polcoeff( eta(x^2 + A)^5 * eta(x^8 + A)^2 / (eta(x + A)^2 * eta(x^4 + A)^3), n))

%o (PARI) a(n) = local(A, p, e); if( n<0, 0, n = 2*n + 1; A = factor(n); prod(k=1, matsize(A)[1], if( p=A[k,1], e=A[k,2]; if( p==2, 0, if( abs(p%8-6)==1, (1+(-1)^e)/2, e+1)))))

%Y Cf. A033761, A093954, A112603, A133692.

%Y Cf. A000122, A000700, A010054, A121373.

%K nonn,easy

%O 0,2

%A _Michael Somos_, Oct 29 2005