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.

Showing 1-6 of 6 results.

A115516 The mode of the bits of n (using 0 if bimodal).

Original entry on oeis.org

0, 1, 0, 1, 0, 1, 1, 1, 0, 0, 0, 1, 0, 1, 1, 1, 0, 0, 0, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 1, 1, 0, 0, 0, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 1, 1, 0, 0, 0, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 0, 1, 1, 1, 0
Offset: 0

Views

Author

Rick L. Shepherd, Jan 23 2006

Keywords

Comments

If n is a term of A044951, A115517(n) = a(n); otherwise, A115517(n) = 1 and a(n) = 0 (and n is a term of A031443).

Examples

			a(5)=1 because 5 = 101 (binary) and 0 occurs once, but 1 occurs twice, so 1 is the mode. 5 is a member of A044951 (Numbers with no two equally numerous base 2 digits).
a(10)=0 because 10 = 1010 (binary), where 0 and 1 each occur twice. As these bits are bimodal, 0 is chosen. 10 is a member of A031443 (Digitally balanced numbers: numbers which in base 2 have the same number of 0's as 1's.).
		

Crossrefs

Cf. A115517 (same but use 1 if bimodal), A031443 (n's bits bimodal), A044951 (n's bits unimodal), A115353 (mode of n's decimal digits).

Programs

  • Mathematica
    Array[Min[Commonest[IntegerDigits[#, 2]]] &, 100, 0] (* Paolo Xausa, May 21 2024 *)
  • PARI
    {for(n=0,104, b=binary(n); l=length(b); s=sum(m=1,l,b[m]); if(s>l-s, a=1, a=0); print1(a,","))}

Formula

a(A031443(k))=0 for k>=1.

A115517 The mode of the bits of n (using 1 if bimodal).

Original entry on oeis.org

0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 1, 1, 0, 0, 0, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 0, 1, 1, 1, 0
Offset: 0

Views

Author

Rick L. Shepherd, Jan 23 2006

Keywords

Comments

If n is a term of A044951, A115516(n) = a(n); otherwise, A115516(n) = 0 and a(n) = 1 (and n is a term of A031443).

Examples

			a(5)=1 because 5 = 101 (binary) and 0 occurs once, but 1 occurs twice, so 1 is the mode. 5 is a member of A044951 (Numbers with no two equally numerous base 2 digits).
a(10)=1 because 10 = 1010 (binary), where 0 and 1 each occur twice. As these bits are bimodal, 1 is chosen. 10 is a member of A031443 (Digitally balanced numbers: numbers which in base 2 have the same number of 0's as 1's.).
		

Crossrefs

Cf. A115516 (same but use 0 if bimodal), A031443 (n's bits bimodal), A044951 (n's bits unimodal), A115353 (mode of n's decimal digits).

Programs

  • Mathematica
    {0}~Join~Table[If[DigitCount[n, 2, 0] > DigitCount[n, 2, 1], 0, 1], {n, 120}] (* Harvey P. Dale, Jul 29 2019 *)
    Array[Max[Commonest[IntegerDigits[#, 2]]] &, 100, 0] (* Paolo Xausa, May 21 2024 *)
  • PARI
    {for(n=0,104, b=binary(n); l=length(b); s=sum(m=1,l,b[m]); if(s>=l-s, a=1, a=0); print1(a,","))}
    
  • Python
    def a(n): return int(n.bit_count() >= ((n.bit_length()+1)>>1)) if n else 0
    print([a(n) for n in range(105)]) # Michael S. Branicky, May 21 2024

Formula

a(A031443(k))=1 for k>=1.

A373064 The mode of the digits of n (using largest mode if multimodal).

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 1, 1, 2, 3, 4, 5, 6, 7, 8, 9, 2, 2, 2, 3, 4, 5, 6, 7, 8, 9, 3, 3, 3, 3, 4, 5, 6, 7, 8, 9, 4, 4, 4, 4, 4, 5, 6, 7, 8, 9, 5, 5, 5, 5, 5, 5, 6, 7, 8, 9, 6, 6, 6, 6, 6, 6, 6, 7, 8, 9, 7, 7, 7, 7, 7, 7, 7, 7, 8, 9, 8, 8, 8, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 1, 2, 3, 4
Offset: 0

Views

Author

Paolo Xausa, May 21 2024

Keywords

Comments

First differs from A054055 at n = 100.

Examples

			a(100) = 0 because 0 is the digit occurring with the highest frequency in 100.
a(123300) = 3 because both 0 and 3 occur with the (same) highest frequency in 123300, and 3 is the largest digit.
		

Crossrefs

Programs

  • Mathematica
    Array[Max[Commonest[IntegerDigits[#]]] &, 120, 0]
  • Python
    from statistics import multimode
    def a(n): return int(max(multimode(str(n))))
    print([a(n) for n in range(105)]) # Michael S. Branicky, May 21 2024

A379180 Nonnegative integers with mode and mean of the digits equal.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 22, 33, 44, 55, 66, 77, 88, 99, 111, 222, 333, 444, 555, 666, 777, 888, 999, 1012, 1021, 1102, 1111, 1120, 1201, 1210, 1223, 1232, 1322, 1335, 1353, 1447, 1474, 1533, 1559, 1595, 1744, 1955, 2011, 2024, 2042, 2101, 2110, 2123, 2132
Offset: 1

Views

Author

Stefano Spezia, Dec 17 2024

Keywords

Examples

			1021 is a term since the mode and the mean of the digits are equal to 1.
		

Crossrefs

Programs

  • Mathematica
    Select[Range[0,2200], Commonest[IntegerDigits[#]] == {Mean[IntegerDigits[#]]} &]

A383306 Nonnegative integers whose difference between the largest and smallest digits is equal to the mode of its digits.

Original entry on oeis.org

0, 101, 110, 112, 121, 202, 211, 220, 224, 242, 303, 330, 336, 363, 404, 422, 440, 448, 484, 505, 550, 606, 633, 660, 707, 770, 808, 844, 880, 909, 990, 1011, 1022, 1033, 1044, 1055, 1066, 1077, 1088, 1099, 1101, 1110, 1112, 1121, 1202, 1211, 1220, 1223, 1232
Offset: 1

Views

Author

Stefano Spezia, Apr 22 2025

Keywords

Comments

It includes only terms with unimodal digits.

Examples

			363 is a term since 6 - 3 = 3 is equal to the mode of {3, 3, 6}.
		

Crossrefs

Programs

  • Mathematica
    Select[Range[0,1400], {Max[d=IntegerDigits[#]]-Min[d]}==Commonest[d] &]

A383307 a(n) is number of n-digit nonnegative integers whose difference between the largest and smallest digits is equal to the mode of its digits.

Original entry on oeis.org

1, 0, 30, 631, 8318, 84939, 762621, 6836799, 66714966, 698183347, 7345264685, 74862560359, 738289921745, 7152117119827, 69258386123495, 678852874461343, 6757612542040310, 67956663939884115, 684414144298352061, 6858156111567293583, 68247431544857431593, 675967074881581484903
Offset: 1

Views

Author

Stefano Spezia, Apr 22 2025

Keywords

Crossrefs

Programs

  • Mathematica
    a[n_]:=Module[{c=KroneckerDelta[n,1]}, For[k=10^(n-1), k<=10^n, k++, If[{Max[d=IntegerDigits[k]]-Min[d]}==Commonest[d], c++]]; c]; Array[a,6]

Formula

Conjecture: lim_{n->oo} a(n+1)/a(n) = 10. - Stefano Spezia, Apr 26 2025

Extensions

More terms from Bert Dobbelaere, Apr 25 2025
Showing 1-6 of 6 results.