A378782 a(1) = 1. For n > 1, a(n) is the number of terms a(i), 1 <= i <= n-1 where the sum of the digits of a(i) is <= sum of digits of a(n-1).
1, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 3, 6, 10, 4, 9, 16, 14, 11, 6, 15, 16, 19, 23, 13, 11, 7, 23, 16, 25, 26, 28, 32, 17, 30, 10, 5, 20, 9, 37, 40, 16, 33, 27, 41, 23, 24, 30, 13, 18, 47, 51, 33, 34, 42, 35, 47, 57, 58, 59, 60, 36, 54, 55, 59, 65, 62, 49, 66, 65
Offset: 1
Examples
a(11) = 10 because a(10) = 9, and no prior term has greater sum of decimal digits. Likewise a(17) = 16, a(24) = 23, a(33) = 32. But a(40) = 37 because 2 prior terms have greater digit sums than a(39).
Links
- Michael De Vlieger, Table of n, a(n) for n = 1..10000
- Michael De Vlieger, Log log scatterplot of a(n), n = 1..10^6.
Programs
-
Mathematica
c[_] := 0; a[1] = j = s = 1; nn = 120; Do[k = DigitSum[j]; c[k]++; k = Total@ Array[c, k]; Set[{a[n], j}, {k, k}], {n, 2, nn}]; Array[a, nn] (* Michael De Vlieger, Dec 07 2024 *)
Comments