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.
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
Links
- Bence Bernáth, Table of n, a(n) for n = 0..10000
- Eric Angelini, Digit-counters updating themselves
- Bence Bernáth, Scatter plot for n=0..500000
- 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.
Programs
-
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
-
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 *)
-
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])))))
Comments