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.

A383667 Binary words beginning with 1 in which no binary digit occurs only once.

Original entry on oeis.org

11, 111, 1001, 1010, 1100, 1111, 10001, 10010, 10011, 10100, 10101, 10110, 11000, 11001, 11010, 11100, 11111, 100001, 100010, 100011, 100100, 100101, 100110, 100111, 101000, 101001, 101010, 101011, 101100, 101101, 101110, 110000, 110001, 110010, 110011
Offset: 1

Views

Author

Clark Kimberling, May 07 2025

Keywords

Crossrefs

Programs

  • Mathematica
    s = Select[Range[200], DigitCount[#, 2, 0] != 1 && DigitCount[#, 2, 1] != 1 &]
    Map[First, RealDigits[s, 2]]; Map[FromDigits, m]
  • Python
    def A383667(n):
        def f(x):
            if x<=1: return n+x
            l, s = x.bit_length(), bin(x)[2:]
            if (m:=s.count('0'))>0: return n+s.index('0')-(m>1)+(l*(l-1)>>1)
            return n-1+(l*(l+1)>>1)
        m, k = n, f(n)
        while m != k: m, k = k, f(k)
        return int(bin(m)[2:]) # Chai Wah Wu, May 21 2025