login
A358851
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.
3
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, 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, 8, 5, 9, 4, 9, 5, 10, 17, 6, 6, 7, 7, 8, 6
OFFSET
0,4
COMMENTS
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).
LINKS
Michael De Vlieger, Log log scatterplot of a(n) n = 1..10^6.
Michael De Vlieger, Log log scatterplot of a(n), n = 1..10^5, with a color function indicating largest digit of preceding term, where black = 0, red = 1, orange = 2, ..., magenta = 9.
MATHEMATICA
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 *)
PROG
(MATLAB)
length_seq=150;
sequence(1)=0;
seq_for_digits=(num2str(sequence(1))-'0');
for i1=1:1:length_seq
sequence(i1+1)=sum(seq_for_digits==max((num2str(sequence(i1))-'0'))');
seq_for_digits=[seq_for_digits, num2str(sequence(i1+1))-'0'];
end
(Python)
sequence=[0]
length=150
seq_for_digits=list(map(int, list(str(sequence[0]))))
for ii in range(length):
sequence.append(seq_for_digits.count(max(list(map(int, list(str(sequence[-1])))))))
seq_for_digits.extend(list(map(int, list(str(sequence[-1])))))
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Bence Bernáth, Dec 08 2022
STATUS
approved