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.

A158582 Numbers with at least two zeros in their binary representation.

Original entry on oeis.org

4, 8, 9, 10, 12, 16, 17, 18, 19, 20, 21, 22, 24, 25, 26, 28, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 48, 49, 50, 51, 52, 53, 54, 56, 57, 58, 60, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91
Offset: 1

Views

Author

Reinhard Zumkeller, Apr 16 2009

Keywords

Comments

Subsequence of A158581; complement of A089633; A023416(a(n))>1.
A265705(a(n),k) != A265705(a(n),a(n)-k) for at least one k <= a(n). - Reinhard Zumkeller, Dec 15 2015

Crossrefs

Programs

  • Haskell
    a158582 n = a158582_list !! (n-1)
    a158582_list = [x | x <- [0..], a023416 x > 1]
    -- Reinhard Zumkeller, Mar 31 2015
    
  • Mathematica
    Select[Range[100],DigitCount[#,2,0]>1&] (* Harvey P. Dale, Jan 19 2015 *)
  • Python
    def A158582(n):
        def f(x):
            c = n+(((l:=(x+1).bit_length())+1)*(l-2)>>1)
            m = bin(x+1)[2:].find('0')
            c += m if m>-1 else l
            return c
        m, k = n, f(n)
        while m != k: m, k = k, f(k)
        return m # Chai Wah Wu, Dec 24 2024