login
A359031
a(n+1) gives the number of occurrences of the mode of the digits of a(n) among all the digits of [a(0), a(1), ..., a(n)], with a(0)=0.
1
0, 1, 1, 2, 1, 3, 1, 4, 1, 5, 1, 6, 1, 7, 1, 8, 1, 9, 1, 10, 2, 2, 3, 2, 4, 2, 5, 2, 6, 2, 7, 2, 8, 2, 9, 2, 10, 3, 3, 4, 3, 5, 3, 6, 3, 7, 3, 8, 3, 9, 3, 10, 4, 4, 5, 4, 6, 4, 7, 4, 8, 4, 9, 4, 10, 5, 5, 6, 5, 7, 5, 8, 5, 9, 5, 10, 6, 6, 7, 6, 8, 6, 9, 6, 10, 7, 7, 8, 7, 9, 7, 10
OFFSET
0,4
COMMENTS
The mode is the most frequently occurring value among the digits of a(n). When there are multiple values occurring equally frequently, the mode is the smallest of those values.
Up to a(464)=110, the terms are identical to A358967.
PROG
(MATLAB)
length_seq=470;
sequence(1)=0;
seq_for_digits=(num2str(sequence(1))-'0');
for i1=1:1:length_seq
sequence(i1+1)=sum(seq_for_digits==mode((num2str(sequence(i1))-'0'))');
seq_for_digits=[seq_for_digits, num2str(sequence(i1+1))-'0'];
end
(Python)
import statistics as stat
sequence=[0]
length=470
seq_for_digits=list(map(int, list(str(sequence[0]))))
for ii in range(length):
sequence.append(seq_for_digits.count(stat.mode(list(map(int, list(str(sequence[-1])))))))
seq_for_digits.extend(list(map(int, list(str(sequence[-1])))))
KEYWORD
nonn,base,look
AUTHOR
Bence Bernáth, Dec 12 2022
STATUS
approved