A370895 Partial alternating sums of Pillai's arithmetical function (A018804).
1, -2, 3, -5, 4, -11, 2, -18, 3, -24, -3, -43, -18, -57, -12, -60, -27, -90, -53, -125, -60, -123, -78, -178, -113, -188, -107, -211, -154, -289, -228, -340, -235, -334, -217, -385, -312, -423, -298, -478, -397, -592, -507, -675, -486, -621, -528, -768, -635, -830
Offset: 1
Links
- Amiram Eldar, Table of n, a(n) for n = 1..10000
- László Tóth, Alternating Sums Concerning Multiplicative Arithmetic Functions, Journal of Integer Sequences, Vol. 20 (2017), Article 17.2.1.
Crossrefs
Programs
-
Mathematica
f[p_, e_] := (e*(p - 1)/p + 1)*p^e; pil[n_] := Times @@ f @@@ FactorInteger[n]; Accumulate[Array[(-1)^(#+1) * pil[#] &, 100]]
-
PARI
pil(n) = {my(f=factor(n)); prod(i=1, #f~, (f[i, 2]*(f[i, 1]-1)/f[i, 1] + 1)*f[i, 1]^f[i, 2]);} lista(kmax) = {my(s = 0); for(k = 1, kmax, s += (-1)^(k+1) * pil(k); print1(s, ", "))};