cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A115353 The mode of the digits of n (using smallest mode if multimodal).

This page as a plain text file.
%I A115353 #11 Jan 28 2023 23:36:19
%S A115353 0,1,2,3,4,5,6,7,8,9,0,1,1,1,1,1,1,1,1,1,0,1,2,2,2,2,2,2,2,2,0,1,2,3,
%T A115353 3,3,3,3,3,3,0,1,2,3,4,4,4,4,4,4,0,1,2,3,4,5,5,5,5,5,0,1,2,3,4,5,6,6,
%U A115353 6,6,0,1,2,3,4,5,6,7,7,7,0,1,2,3,4,5,6,7,8,8,0,1,2,3,4,5,6,7,8,9,0,1,0,0,0
%N A115353 The mode of the digits of n (using smallest mode if multimodal).
%C A115353 a(101)=1 and A054054(101)=0, but all previous terms are equivalent.
%H A115353 Bence BernĂ¡th, <a href="/A115353/b115353.txt">Table of n, a(n) for n = 0..10000</a>
%e A115353 a(12)=1 because 1, 2, the digits of 12, each occur the same number of times and 1 is the smaller of the two modes.
%e A115353 a(101)=1 because 1 is the unique mode of 1, 0, 1 (occurring twice while 0 appears only once).
%t A115353 a[n_] := Min[Commonest[IntegerDigits[n]]]; Array[a,105,0] (* _Stefano Spezia_, Jan 08 2023 *)
%o A115353 (MATLAB)
%o A115353 function nth_term=A115353(n)
%o A115353      nth_term=mode((num2str(n)-'0'));
%o A115353 end
%o A115353 sequence = arrayfun(@A115353, linspace(0,105,106))
%o A115353 % _Bence BernĂ¡th_, Jan 06 2023
%o A115353 (Python)
%o A115353 from statistics import mode
%o A115353 def a(n): return int(mode(sorted(str(n))))
%o A115353 print([a(n) for n in range(105)]) # _Michael S. Branicky_, Jan 08 2023
%Y A115353 Cf. A054054 (Smallest digit of n).
%K A115353 base,nonn
%O A115353 0,3
%A A115353 _Rick L. Shepherd_, Jan 21 2006