OFFSET
1,2
LINKS
Antti Karttunen, Table of n, a(n) for n = 1..65537
FORMULA
a(1)=1, a(p_1^b_1*p_2^b_2*...*p_n^b_n)=p_1*a(b_1)+p_2*a(b_2)+...+p_n*a(b_n) where p_i is the i-th prime number.
EXAMPLE
a(100) = a(2^2*5^2) = 2*a(2) + 5*a(2) = 2*2*a(1) + 5*2*a(1) = 2*2*1 + 5*2*1 = 14.
MAPLE
a:= proc(n) option remember; `if`(n=1, 1,
add(i[1]*a(i[2]), i=ifactors(n)[2]))
end:
seq(a(n), n=1..100); # Alois P. Heinz, Aug 22 2020
MATHEMATICA
f[p_, e_] := p * a[e]; a[1] = 1; a[n_] := a[n] = Plus @@ (f @@@ FactorInteger[n]); Array[a, 100] (* Amiram Eldar, Aug 22 2020 *)
PROG
(PARI) a(n)={my(f=factor(n)); if(n==1, 1, sum(i=1, #f~, my([p, e]=f[i, ]); p*a(e)))} \\ Andrew Howroyd, Aug 22 2020
CROSSREFS
KEYWORD
nonn
AUTHOR
Ferdinand Rönngren and Lars Kevin Haagensen Strömberg, Aug 22 2020
STATUS
approved