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.

A190619 Binary expansions of odd numbers with a single zero in their binary expansion.

Original entry on oeis.org

101, 1011, 1101, 10111, 11011, 11101, 101111, 110111, 111011, 111101, 1011111, 1101111, 1110111, 1111011, 1111101, 10111111, 11011111, 11101111, 11110111, 11111011, 11111101, 101111111, 110111111, 111011111, 111101111, 111110111, 111111011, 111111101, 1011111111, 1101111111, 1110111111, 1111011111, 1111101111, 1111110111, 1111111011, 1111111101
Offset: 1

Views

Author

N. J. A. Sloane, May 14 2011

Keywords

Comments

a(n) = A007088(A190620(n)). [Reinhard Zumkeller, May 14 2011]

Programs

  • Haskell
    a190619 n = a190619_list !! (n-1)
    a190619_list = map read $ f 2 1 :: [Integer] where
      f m k
        | k < m - 1 = ((take k ones) ++ "0" ++ (take (m-k) ones)) : f m (k+1)
        | otherwise = ((take k ones) ++ "01") : f (m + 1) 1
      ones = repeat '1'
    -- Reinhard Zumkeller, May 15 2011
    
  • Maple
    f:=k->(10^k-1)/9; for n from 3 to 12 do for i from n-2 by -1 to 1 do j:=f(n)-10^i; lprint(j); od; od;
  • Python
    from itertools import count, islice
    def agen():
        for d in count(3):
            b = (10**d - 1)//9
            for i in range(2, d):
                yield b - 10**(d-i)
    print(list(islice(agen(), 50))) # Michael S. Branicky, Oct 13 2022
    
  • Python
    from math import isqrt, comb
    def A190619(n): return (10**((a:=(isqrt(n<<3)+1>>1)+1)+1)-1)//9-10**(comb(a,2)-n+1) # Chai Wah Wu, Dec 18 2024