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”).

a(1) = 1. For n > 1 a(n) is the number of terms a(i); 1 <= i <= n-1 such that d(a(i)) >= d(a(n-1)), where d is the decimal digital sum function A007953.
0

%I #15 Dec 26 2024 20:07:36

%S 1,1,2,1,4,1,6,1,8,1,10,11,5,3,5,4,6,3,9,1,20,13,9,2,16,4,12,15,7,5,

%T 11,23,12,20,26,4,18,3,24,11,32,16,8,6,14,20,38,1,48,1,50,23,24,17,9,

%U 6,20,47,3,40,35,12,43,16,17,13,40,41,34,19,4,45,9,10,74,4,49,1,78,1,80

%N a(1) = 1. For n > 1 a(n) is the number of terms a(i); 1 <= i <= n-1 such that d(a(i)) >= d(a(n-1)), where d is the decimal digital sum function A007953.

%C d(a(n-1)) >= d(a(i)); 1 <= i <= n-1 implies a(n) = 1. a(n) <= n-1 for all n > 1, with equality iff d(a(n-1)) = 1.

%C Compare with A356348 and A378782.

%e a(1) = 1 so a(2) also = 1 since there is only one term up to and including a(1) = 1 which has digit sum >= 1. Then a(3) = 2 because now there are two terms having digit sum >= 1. a(11) = 10 so a(12) = 11 since all terms up to and including a(11) have digit sum >= 1. a(19) = 9, whose digit sum (9) sets a record, thus a(20) = 1, which means a(21) = 20.

%o (PARI) first(n) = {

%o my(res = vector(n), digs = vector(n));

%o res[1] = 1; digs[1] = 1;

%o for(i = 2, n,

%o s = 1 + sum(j = 1, i-2, digs[j] >= digs[i-1]);

%o res[i] = s;

%o digs[i] = sumdigits(s)

%o );

%o res

%o } \\ _David A. Corneth_, Dec 24 2024

%Y Cf. A007953, A378293, A378782, A356348.

%K nonn,base,new

%O 1,3

%A _David James Sycamore_, Dec 09 2024

%E More terms from _David A. Corneth_, Dec 24 2024