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.

A037013 Reading binary expansion from right to left, run lengths strictly decrease.

Original entry on oeis.org

0, 1, 3, 4, 7, 8, 15, 16, 24, 31, 32, 39, 48, 63, 64, 79, 96, 112, 127, 128, 143, 159, 192, 224, 255, 256, 287, 319, 384, 399, 448, 480, 511, 512, 543, 575, 624, 639, 768, 799, 896, 960, 1023, 1024, 1087, 1151, 1248, 1279, 1536, 1567, 1599, 1792, 1920, 1984, 2047, 2048, 2111
Offset: 1

Views

Author

Keywords

Crossrefs

Subsequence of A037014, cf. A037015, A037016.

Programs

  • Haskell
    import Data.List (unfoldr, group)
    a037013 n = a037013_list !! (n-1)
    a037013_list = 0 : filter
       (all (< 0) . (\x -> zipWith (-) (tail $ rls x) $ rls x)) [1..] where
           rls = map length . group . unfoldr
                 (\x -> if x == 0 then Nothing else Just $ swap $ divMod x 2)
    -- Reinhard Zumkeller, Mar 10 2012
  • Mathematica
    Select[Range[0,2200],Min[Differences[Length/@Split[ IntegerDigits[ #,2]]]]>0&] (* Harvey P. Dale, Dec 17 2012 *)

Extensions

More terms from Patrick De Geest, Feb 15 1999
Offset fixed and missing 1024 and 2047 inserted by Reinhard Zumkeller, Mar 10 2012