OFFSET
1,4
COMMENTS
Note that this sequence differs from A058974 at n = 26, 33, 38, 52, 62, 69, 70, 74, 76, 86, 99, etc.
LINKS
Antti Karttunen, Table of n, a(n) for n = 1..16384
EXAMPLE
a(14) = 12 because f(14) = 2+7 = 9 and f(9) = 3 and 9+3 = 12.
From David A. Corneth, Oct 30 2017: (Start)
To find the first 20 terms, make a list called res with offset 1 of size 20. For each prime p, increase multiples p * k of p with k > 1 by p. This gives
[0, 0, 0, 2, 0, 5, 0, 2, 3, 7, 0, 5, 0, 9, 8, 2, 0, 5, 0, 7].
Then, from the last element to the first, increase that element with the value of that element. For example, res[20] is 7, so we increase res[20] with the value of res[7]. res[7] is 0, so a(20) = 7 + 0 = 7. Repeat for all terms until 1. (End)
MATHEMATICA
f[n_Integer] := If[n == 1 || PrimeQ[n], 0, Plus@@First[ Transpose[ FactorInteger[n] ] ] ]; Table[ f[n] + f[f[n]], {n, 1, 80} ]
PROG
(PARI)
A008472(n) = vecsum(factor(n)[, 1]); \\ M. F. Hasler, Jul 18 2015
f(n) = if((n<=1)||isprime(n), 0, A008472(n));
A061376(n) = f(n) + f(f(n)); \\ Antti Karttunen, Oct 30 2017
(PARI) first(n) = {my(res = vector(n)); forprime(p = 2, n, for(k = 2, n \ p, res[k*p] += p)); forstep(i = n, 1, -1, if(res[i]!=0, res[i] += res[res[i]])); res} \\ David A. Corneth, Oct 30 2017
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Robert G. Wilson v, Jun 08 2001
EXTENSIONS
Minor correction to the formula from Antti Karttunen, Oct 30 2017
STATUS
approved
