login
A369180
Alternating sum of the k-adic valuations (ruler functions) of n.
3
0, 1, -1, 3, -1, 1, -1, 5, -3, 1, -1, 4, -1, 1, -3, 8, -1, 0, -1, 4, -3, 1, -1, 7, -3, 1, -5, 4, -1, 1, -1, 10, -3, 1, -3, 5, -1, 1, -3, 7, -1, 1, -1, 4, -6, 1, -1, 11, -3, 0, -3, 4, -1, -1, -3, 7, -3, 1, -1, 6, -1, 1, -6, 14, -3, 1, -1, 4, -3, 1, -1, 9, -1, 1, -6, 4, -3, 1
OFFSET
1,4
LINKS
FORMULA
a(n) = Sum_{k=2..n} (-1)^k * valuation(n,k).
a(n) = A007814(n) - A007949(n) + A235127(n) - (...).
G.f.: Sum_{k>=2, j>=1} (-1)^k x^(k^j)/(1-x^(k^j)).
Asymptotic mean: lim_{m->oo} (1/m) * Sum_{n=1..m} a(n) = log(2).
Dirichlet g.f.: zeta(s) * Sum_{k>=1} (1 - eta(ks)).
Sum_{n>=1} a(n)/n^2 = Pi^2/24.
MAPLE
a:= n-> add((-1)^i*padic[ordp](n, i), i=2..n):
seq(a(n), n=1..78); # Alois P. Heinz, Jan 15 2024
MATHEMATICA
z = 70; Sum[(-1)^k IntegerExponent[Range[z], k], {k, 2, z}]
PROG
(PARI) a(n) = sum(k=2, n, (-1)^k * valuation(n, k)); \\ Michel Marcus, Jan 18 2024
CROSSREFS
KEYWORD
sign
AUTHOR
Friedjof Tellkamp, Jan 15 2024
STATUS
approved