login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A037014
Numbers n with property that reading binary expansion from right to left (from least significant to most significant), run lengths do not increase.
5
0, 1, 2, 3, 4, 5, 7, 8, 10, 11, 12, 15, 16, 19, 20, 21, 23, 24, 31, 32, 39, 40, 42, 43, 44, 47, 48, 51, 56, 63, 64, 71, 76, 79, 80, 83, 84, 85, 87, 88, 95, 96, 103, 112, 127, 128, 143, 152, 159, 160, 167, 168, 170, 171, 172, 175, 176, 179, 184, 191, 192, 199, 204, 207
OFFSET
1,3
MATHEMATICA
Select[Range[0, 250], Min[Differences[Length/@Split[IntegerDigits[ #, 2]]]]>= 0&] (* Harvey P. Dale, Jan 30 2013 *)
PROG
(Haskell)
import Data.List (unfoldr, group)
a037014 n = a037014_list !! (n-1)
a037014_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
Cf. A037013 (subsequence), A037016, A037015.
Sequence in context: A340608 A047503 A228803 * A261131 A225061 A133223
KEYWORD
nonn,easy,base,nice
EXTENSIONS
More terms from Patrick De Geest, Feb 15 1999
Offset fixed by Reinhard Zumkeller, Mar 10 2012
STATUS
approved