%I #46 Dec 23 2024 14:53:46
%S 0,1,1,2,1,3,1,4,1,5,1,6,1,7,1,8,1,9,1,10,11,13,2,2,3,3,4,2,4,3,5,2,5,
%T 3,6,2,6,3,7,2,7,3,8,2,8,3,9,2,9,3,10,15,4,4,5,5,6,4,6,5,7,4,7,5,8,4,
%U 8,5,9,4,9,5,10,17,6,6,7,7,8,6
%N a(n+1) is the number of occurrences of the largest digit of a(n) among all the digits of [a(0), a(1), ..., a(n)], with a(0)=0.
%C Up to a(19)=10, the terms are identical to A248034. The branches (distinct lines of terms indicating the largest digit of the preceding term) can be labeled by the counter digit (shown in the scatter plot). From 9 to 1 the branches gradually get fragmented. Below digit 5 it is harder to disentangle the branches in some places. A repeating pattern also appears (shown in the inset of the scatter plot).
%H Bence Bernáth, <a href="/A358851/b358851.txt">Table of n, a(n) for n = 0..10000</a>
%H Eric Angelini, <a href="https://web.archive.org/web/*/http://list.seqfan.eu/oldermail/seqfan/2014-October/013784.html">Digit-counters updating themselves</a>
%H Bence Bernáth, <a href="/A358851/a358851.jpg">Scatter plot for n=0..500000</a>
%H Michael De Vlieger, <a href="/A358851/a358851.png">Log log scatterplot of a(n)</a> n = 1..10^6.
%H Michael De Vlieger, <a href="/A358851/a358851_1.png">Log log scatterplot of a(n)</a>, n = 1..10^5, with a color function indicating largest digit of preceding term, where black = 0, red = 1, orange = 2, ..., magenta = 9.
%t nn = 79; s[_] = 0; a[0] = 0; Do[(Set[d, Max[#]]; Map[s[#1] += #2 & @@ # &, Tally[#] ]) &@ IntegerDigits[a[n - 1]]; a[n] = s[d], {n, nn}]; Array[a, nn + 1, 0] (* _Michael De Vlieger_, Dec 28 2022 *)
%o (MATLAB)
%o length_seq=150;
%o sequence(1)=0;
%o seq_for_digits=(num2str(sequence(1))-'0');
%o for i1=1:1:length_seq
%o sequence(i1+1)=sum(seq_for_digits==max((num2str(sequence(i1))-'0'))');
%o seq_for_digits=[seq_for_digits, num2str(sequence(i1+1))-'0'];
%o end
%o (Python)
%o sequence=[0]
%o length=150
%o seq_for_digits=list(map(int, list(str(sequence[0]))))
%o for ii in range(length):
%o sequence.append(seq_for_digits.count(max(list(map(int,list(str(sequence[-1])))))))
%o seq_for_digits.extend(list(map(int, list(str(sequence[-1])))))
%Y Cf. A248034, A249009, A356348, A336514.
%K nonn,base
%O 0,4
%A _Bence Bernáth_, Dec 08 2022