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.
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
Offset: 1
Examples
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)
Links
- Antti Karttunen, Table of n, a(n) for n = 1..16384
Programs
-
Mathematica
f[n_Integer] := If[n == 1 || PrimeQ[n], 0, Plus@@First[ Transpose[ FactorInteger[n] ] ] ]; Table[ f[n] + f[f[n]], {n, 1, 80} ]
-
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
Extensions
Minor correction to the formula from Antti Karttunen, Oct 30 2017
Comments