|
|
A061376
|
|
a(n) = f(n) + f(f(n)) where f(n) = 0 if n <= 1 or a prime, otherwise f(n) = sum of distinct primes dividing n.
|
|
2
|
|
|
0, 0, 0, 2, 0, 5, 0, 2, 3, 7, 0, 5, 0, 12, 10, 2, 0, 5, 0, 7, 17, 13, 0, 5, 5, 23, 3, 12, 0, 17, 0, 2, 23, 19, 17, 5, 0, 31, 18, 7, 0, 17, 0, 13, 10, 30, 0, 5, 7, 7, 27, 23, 0, 5, 18, 12, 35, 31, 0, 17, 0, 47, 17, 2, 23, 18, 0, 19, 41, 23, 0, 5, 0, 55, 10, 31, 23, 23, 0, 7
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
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
|
|
|
EXAMPLE
|
a(14) = 12 because f(14) = 2+7 = 9 and f(9) = 3 and 9+3 = 12.
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)
f(n) = if((n<=1)||isprime(n), 0, A008472(n));
(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
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|