login
A343923
If n = Product (p_j^k_j) then a(n) = Sum (abs(p_j-k_j)) (a(1) = 0 by convention).
0
0, 1, 2, 0, 4, 3, 6, 1, 1, 5, 10, 2, 12, 7, 6, 2, 16, 2, 18, 4, 8, 11, 22, 3, 3, 13, 0, 6, 28, 7, 30, 3, 12, 17, 10, 1, 36, 19, 14, 5, 40, 9, 42, 10, 5, 23, 46, 4, 5, 4, 18, 12, 52, 1, 14, 7, 20, 29, 58, 6, 60, 31, 7, 4, 16, 13, 66, 16, 24, 11, 70, 2, 72
OFFSET
1,3
FORMULA
Additive with a(p^e) = abs(p-e).
EXAMPLE
a(24) = a(2^3 * 3) = abs(2 - 3) + abs(3 - 1) = 3. a(27) = a(3^3) = 0.
MATHEMATICA
a[n_] := Plus @@ (Abs[#[[1]] - #[[2]]] & /@ FactorInteger[n]); Array[a, 100] (* Amiram Eldar, May 04 2021 *)
PROG
(PARI) a(n)=local(t); if(n<1, 0, t=factor(n); vecsum(abs(t[, 1]-t[, 2])))
CROSSREFS
Cf. A008474.
Sequence in context: A340187 A204187 A095202 * A291937 A243488 A154849
KEYWORD
nonn
AUTHOR
Peter Schorn, May 04 2021
STATUS
approved