login
This site is supported by donations to The OEIS Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A036994 Numbers n with property that reading from right to left in the binary expansion of n, the number of 1's always stays ahead of the number of 0's. 3
1, 3, 7, 11, 15, 23, 27, 31, 39, 43, 47, 55, 59, 63, 79, 87, 91, 95, 103, 107, 111, 119, 123, 127, 143, 151, 155, 159, 167, 171, 175, 183, 187, 191, 207, 215, 219, 223, 231, 235, 239, 247, 251, 255, 287, 303, 311, 315, 319, 335, 343, 347, 351, 359, 363, 367 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,2

COMMENTS

Even numbers can't appear in this sequence. [Alonso del Arte, Sep 21 2011]

LINKS

Reinhard Zumkeller, Table of n, a(n) for n = 1..10000

Index entries for sequences related to binary expansion of n

MATHEMATICA

aheadOnesRLQ[n_Integer] := Module[{digits, len, flag = True, iter = 1, ones = 0, zeros = 0}, digits = Reverse[IntegerDigits[n, 2]]; len = Length[digits]; While[flag && iter < len, If[digits[[iter]] == 1, ones++, zeros++]; flag = ones > zeros; iter++]; flag]; Select[Range[1, 201, 2], aheadOnesRLQ] (* Alonso del Arte, Sep 21 2011 *)

Select[Range[400], Min[Accumulate[Reverse[IntegerDigits[#, 2]/. (0->-1)]]]> 0&] (* Harvey P. Dale, Apr 23 2016 *)

PROG

(Haskell)

a036994 n = a036994_list !! (n-1)

a036994_list = filter ((p 0) . a030308_row) [1, 3 ..] where

   p ones []    = ones > 0

   p ones (0:bs) = ones > 1 && p (ones - 1) bs

   p ones (1:bs) = p (ones + 1) bs

-- Reinhard Zumkeller, Aug 01 2013

CROSSREFS

Cf. A036990, A036991, A036992, A036993.

Cf. A030308.

Sequence in context: A246521 A160785 A095100 * A243115 A279106 A172306

Adjacent sequences:  A036991 A036992 A036993 * A036995 A036996 A036997

KEYWORD

nonn,easy,base

AUTHOR

N. J. A. Sloane.

EXTENSIONS

More terms from Erich Friedman.

STATUS

approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 22 14:13 EDT 2019. Contains 322349 sequences. (Running on oeis4.)