login
A037013
Reading binary expansion from right to left, run lengths strictly decrease.
18
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,3
MATHEMATICA
Select[Range[0, 2200], Min[Differences[Length/@Split[ IntegerDigits[ #, 2]]]]>0&] (* Harvey P. Dale, Dec 17 2012 *)
PROG
(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
CROSSREFS
Subsequence of A037014, cf. A037015, A037016.
Sequence in context: A323247 A285662 A112062 * A050069 A219019 A306612
KEYWORD
nonn,easy,base,nice
EXTENSIONS
More terms from Patrick De Geest, Feb 15 1999
Offset fixed and missing 1024 and 2047 inserted by Reinhard Zumkeller, Mar 10 2012
STATUS
approved