login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

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, 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,3
COMMENTS
Similar definition to A378293, from which this sequence diverges at a(14).
a(n) <= n-1 for all n > 1; equality iff A007953(a(n-1)) >= A007953(a(i)); i = 1..n-1.
LINKS
Michael De Vlieger, Log log scatterplot of a(n), n = 1..10^6.
EXAMPLE
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).
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 *)
CROSSREFS
Sequence in context: A351868 A325721 A079050 * A378293 A320109 A278062
KEYWORD
nonn,base,easy,new
AUTHOR
STATUS
approved