%I #18 Dec 08 2024 17:23:52
%S 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,
%T 16,25,26,28,32,17,30,10,5,20,9,37,40,16,33,27,41,23,24,30,13,18,47,
%U 51,33,34,42,35,47,57,58,59,60,36,54,55,59,65,62,49,66,65
%N 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).
%C Similar definition to A378293, from which this sequence diverges at a(14).
%C a(n) <= n-1 for all n > 1; equality iff A007953(a(n-1)) >= A007953(a(i)); i = 1..n-1.
%H Michael De Vlieger, <a href="/A378782/b378782.txt">Table of n, a(n) for n = 1..10000</a>
%H Michael De Vlieger, <a href="/A378782/a378782.png">Log log scatterplot of a(n)</a>, n = 1..10^6.
%e 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).
%t c[_] := 0; a[1] = j = s = 1; nn = 120;
%t Do[k = DigitSum[j]; c[k]++;
%t k = Total@ Array[c, k];
%t Set[{a[n], j}, {k, k}],
%t {n, 2, nn}];
%t Array[a, nn] (* _Michael De Vlieger_, Dec 07 2024 *)
%Y Cf. A007953, A378293.
%K nonn,base,easy
%O 1,3
%A _David James Sycamore_, Dec 07 2024