A370899 Partial alternating sums of the unitary totient function (A047994).
1, 0, 2, -1, 3, 1, 7, 0, 8, 4, 14, 8, 20, 14, 22, 7, 23, 15, 33, 21, 33, 23, 45, 31, 55, 43, 69, 51, 79, 71, 101, 70, 90, 74, 98, 74, 110, 92, 116, 88, 128, 116, 158, 128, 160, 138, 184, 154, 202, 178, 210, 174, 226, 200, 240, 198, 234, 206, 264, 240, 300, 270
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
uphi[n_] := Times @@ (-1 + Power @@@ FactorInteger[n]); uphi[1] = 1; Accumulate[Array[(-1)^(# + 1) * uphi[#] &, 100]]
-
PARI
uphi(n) = {my(f = factor(n)); prod(i = 1, #f~, f[i, 1]^f[i, 2] - 1);} lista(kmax) = {my(s = 0); for(k = 1, kmax, s += (-1)^(k+1) * uphi(k); print1(s, ", "))};