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-5 of 5 results.

A072601 Numbers which in base 2 have at least as many 1's as 0's.

Original entry on oeis.org

1, 2, 3, 5, 6, 7, 9, 10, 11, 12, 13, 14, 15, 19, 21, 22, 23, 25, 26, 27, 28, 29, 30, 31, 35, 37, 38, 39, 41, 42, 43, 44, 45, 46, 47, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 71, 75, 77, 78, 79, 83, 85, 86, 87, 89, 90, 91, 92, 93, 94, 95, 99, 101, 102, 103
Offset: 1

Views

Author

Reinhard Zumkeller, Jun 23 2002

Keywords

Examples

			8 = 1000_2 is not present (one '1', three '0's).
10 is present because 10=1010_2 contains 2 '0's and 2 '1's: 2<=2;
11 is present because 11=1011_2 contains 1 '0' and 3 '1's: 1<=3.
		

Crossrefs

Cf. A037861(a(n)) <= 0.
Cf. A072600 (#0's < #1's), this seq (#0's <= #1's), A031443 (#0's = #1's).
Cf. A072602 (#0's >= #1's), A072603 (#0's > #1's), A044951 (#0's <> #1's).

Programs

  • Haskell
    a072601 n = a072601_list !! (n-1)
    a072601_list = filter ((<= 0) . a037861) [0..]
    -- Reinhard Zumkeller, Aug 01 2013
    
  • Mathematica
    geQ[n_] := Module[{a, b}, {a, b} = DigitCount[n, 2]; a >= b]; Select[Range[103], geQ] (* T. D. Noe, Apr 20 2013 *)
    Select[Range[110],DigitCount[#,2,1]>=DigitCount[#,2,0]&] (* Harvey P. Dale, Aug 12 2023 *)
  • PARI
    is(n)=2*hammingweight(n)>exponent(n) \\ Charles R Greathouse IV, Apr 18 2020

A167819 Numbers with a distinct frequency for each ternary digit.

Original entry on oeis.org

9, 10, 12, 14, 16, 17, 18, 20, 22, 23, 24, 25, 27, 31, 37, 39, 41, 43, 49, 53, 54, 62, 67, 71, 74, 77, 78, 79, 81, 82, 84, 85, 90, 91, 93, 94, 108, 109, 111, 112, 117, 118, 120, 122, 124, 125, 130, 131, 133, 134, 148, 149, 151, 152, 157, 158, 160, 161, 162, 164, 168
Offset: 1

Views

Author

Keywords

Comments

The smallest number in the sequence that actually contains all 3 ternary digits is 248 = 100012_3. [Corrected by M. F. Hasler, Nov 02 2012]
The number 28 is in A031948 but not in this sequence A167819. This sequence is infinite, e.g. all powers 3^k, k>1 are member. Digit frequencies are [2,1,0] for the first 12 terms (with 3 digits in base 3, from 100[3] to 221[3]), then [3,1,0] for the next 16 terms with 4 digits in base 3 (from 1000[3] to 2221[3]), then [4,1,0] and [3,2,0] (5 digits in base 3, from 10000[3] to 22221[3]), followed by [5,1,0] or [4,2,0] or [3,2,1] (6 digits in base-3, from 10000[3] to 22221[3]), etc. - M. F. Hasler, Nov 02 2012

Examples

			9 = 100_3 is in the sequence, as it has 2 0's, 1 1, and 0 2's.
1 is not in the sequence, as it has the same number (0) of 0's and 2's.
		

Crossrefs

Programs

  • Mathematica
    Select[Range[168],Length[Union[DigitCount[ #,3]]]==3&] (* Zak Seidov, Nov 13 2009 *)
  • PARI
    /* In PARI versions < 2.6, define: digits(n,b=10)=local(r);r=[];while(n>0,r=concat([n%b],r);n\=b);r */
    is_A167819(n)=local(d=digits(n,3),v=vector(3));for(k=1,#d,v[d[k]+1]++);#Set(v)==3
    for(n=1,250,if(is_A167819(n),print1(n",")))

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.

A121977 Numbers with a distinct frequency for each decimal digit.

Original entry on oeis.org

100000000011111112222222333333444445555666778, 100000000011111112222222333333444445555666779, 100000000011111112222222333333444445555666787, 100000000011111112222222333333444445555666788, 100000000011111112222222333333444445555666797, 100000000011111112222222333333444445555666799, 100000000011111112222222333333444445555666877, 100000000011111112222222333333444445555666878
Offset: 1

Views

Author

Keywords

Examples

			100000000011111112222222333333444445555666778 has 9 0's, 8 1's, 7 2's, 6 3's, 5 4's, 4 5's, 3 6's, 2 7's, 1 8 and 0 9's. 121 is not in the sequence because there are eight digits it has zero of.
		

Crossrefs

Subsequence of A179239.
Showing 1-5 of 5 results.