%I #13 Jun 05 2021 17:22:43
%S 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,
%T 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,
%U 20,29,58,6,60,31,7,4,16,13,66,16,24,11,70,2,72
%N If n = Product (p_j^k_j) then a(n) = Sum (abs(p_j-k_j)) (a(1) = 0 by convention).
%F Additive with a(p^e) = abs(p-e).
%e a(24) = a(2^3 * 3) = abs(2 - 3) + abs(3 - 1) = 3. a(27) = a(3^3) = 0.
%t a[n_] := Plus @@ (Abs[#[[1]] - #[[2]]] & /@ FactorInteger[n]); Array[a, 100] (* _Amiram Eldar_, May 04 2021 *)
%o (PARI) a(n)=local(t); if(n<1, 0, t=factor(n); vecsum(abs(t[,1]-t[,2])))
%Y Cf. A008474.
%K nonn
%O 1,3
%A _Peter Schorn_, May 04 2021