login
Partial alternating sums of the alternating sum of divisors function (A206369).
2

%I #11 Mar 05 2024 15:54:25

%S 1,0,2,-1,3,1,7,2,9,5,15,9,21,15,23,12,28,21,39,27,39,29,51,41,62,50,

%T 70,52,80,72,102,81,101,85,109,88,124,106,130,110,150,138,180,150,178,

%U 156,202,180,223,202,234,198,250,230,270,240,276,248,306,282,342

%N Partial alternating sums of the alternating sum of divisors function (A206369).

%H Amiram Eldar, <a href="/A370906/b370906.txt">Table of n, a(n) for n = 1..10000</a>

%H László Tóth, <a href="https://www.emis.de/journals/JIS/VOL20/Toth/toth25.html">Alternating Sums Concerning Multiplicative Arithmetic Functions</a>, Journal of Integer Sequences, Vol. 20 (2017), Article 17.2.1.

%F a(n) = Sum_{k=1..n} (-1)^(k+1) * A206369(k).

%F a(n) = (Pi^2/120) * n^2 + O(n * log(n)^(2/3) * log(log(n))^(4/3)) (Tóth, 2017).

%t f[p_, e_] := Sum[(-1)^(e-k)*p^k, {k, 0, e}]; beta[1] = 1; beta[n_] := Times @@ f @@@ FactorInteger[n]; Accumulate[Array[(-1)^(# + 1) * beta[#] &, 100]]

%o (PARI) beta(n) = {my(f = factor(n)); prod(i=1, #f~, p = f[i, 1]; e = f[i, 2]; sum(k = 0, e, (-1)^(e-k)*p^k));}

%o lista(kmax) = {my(s = 0); for(k = 1, kmax, s += (-1)^(k+1) * beta(k); print1(s, ", "))};

%o (Python)

%o from math import prod

%o from sympy import factorint

%o def A370906(n): return sum((1 if k&1 else -1)*prod((lambda x:x[0]+int((x[1]<<1)>=p+1))(divmod(p**(e+1),p+1)) for p, e in factorint(k).items()) for k in range(1,n+1)) # _Chai Wah Wu_, Mar 05 2024

%Y Cf. A206369, A370905.

%Y Similar sequences: A068762, A068773, A307704, A357817, A362028.

%K sign,easy

%O 1,3

%A _Amiram Eldar_, Mar 05 2024