A337903 a(0) = 0, a(1) = 1; for n>1, if a(n-1) is composite then a(n) = a(n-1)/A107286(n-1), where A107286(n) = the smallest prime factor of n, otherwise a(n) = a(n-1) + n.
0, 1, 3, 6, 3, 8, 4, 2, 10, 5, 15, 5, 17, 30, 15, 5, 21, 7, 25, 5, 25, 5, 27, 9, 3, 28, 14, 7, 35, 7, 37, 68, 34, 17, 51, 17, 53, 90, 45, 15, 5, 46, 23, 66, 33, 11, 57, 19, 67, 116, 58, 29, 81, 27, 9, 3, 59, 116, 58, 29, 89, 150, 75, 25, 5, 70, 35, 7, 75, 25, 5, 76, 38, 19, 93, 31, 107, 184, 92
Offset: 0
Keywords
Examples
a(3) = 6 as a(2) = 3 which is prime thus a(3) = 3 + 3 = 6. a(4) = 3 as a(3) = 6 which has the smallest divisor 2 thus a(4) = 6/2 = 3. a(11) = 5 as a(10) = 15 which has the smallest divisor 3 thus a(11) = 15/3 = 5.
Links
- Scott R. Shannon, Graph of the first 10 million terms.
Programs
-
Mathematica
a[0] = 0; a[1] = 1; a[n_] := a[n] = If[CompositeQ[a[n - 1]], a[n - 1]/FactorInteger[a[n - 1]][[1, 1]], a[n - 1] + n]; Array[a, 100, 0] (* Amiram Eldar, Sep 30 2020 *)
Comments