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).

Original entry on oeis.org

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, 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, 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
Offset: 0

Views

Author

Rick L. Shepherd, Jan 21 2006

Keywords

Comments

a(101)=1 and A054054(101)=0, but all previous terms are equivalent.

Examples

			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.
a(101)=1 because 1 is the unique mode of 1, 0, 1 (occurring twice while 0 appears only once).
		

Crossrefs

Cf. A054054 (Smallest digit of n).

Programs

  • MATLAB
    function nth_term=A115353(n)
         nth_term=mode((num2str(n)-'0'));
    end
    sequence = arrayfun(@A115353, linspace(0,105,106))
    % Bence BernĂ¡th, Jan 06 2023
    
  • Mathematica
    a[n_] := Min[Commonest[IntegerDigits[n]]]; Array[a,105,0] (* Stefano Spezia, Jan 08 2023 *)
  • Python
    from statistics import mode
    def a(n): return int(mode(sorted(str(n))))
    print([a(n) for n in range(105)]) # Michael S. Branicky, Jan 08 2023