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
KEYWORD
nonn
AUTHOR
Peter Schorn, May 04 2021
STATUS
approved