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

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A090996 Number of leading 1's in binary expansion of n. 8
0, 1, 1, 2, 1, 1, 2, 3, 1, 1, 1, 1, 2, 2, 3, 4, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 4, 5, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 5, 6, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2 (list; graph; refs; listen; history; text; internal format)
OFFSET

0,4

COMMENTS

Mirror of triangle A065120. See example. - Omar E. Pol, Oct 17 2013

LINKS

Vincenzo Librandi, Table of n, a(n) for n = 0..10000

Index entries for sequences related to binary expansion of n

FORMULA

a(2^k-1)=k; a(A004754(k))=1; a(A004758(k))=2.

a(2^k-1)=k; for any other n, a(n) = a(floor(n/2)).

a(n) = f(n, 0) with f(n, x) = if n < 2 then n + x else f([n/2], (x+1)*(n mod 2)). - Reinhard Zumkeller, Feb 02 2007

Conjecture: a(n) = w(n+1)*(w(n+1)-w(n)+1) - w(2^(w(n+1)+1)-n-1) for n>0, where w(n) = floor(log_2(n)), that is, A000523(n). - Velin Yanev, Dec 21 2016

EXAMPLE

In binary : 14=1110 and there are 3 leading 1's, so a(14)=3.

From Omar E. Pol, Oct 17 2013: (Start)

Written as an irregular triangle with row lengths A011782 the sequence begins:

0;

1;

1,2;

1,1,2,3;

1,1,1,1,2,2,3,4;

1,1,1,1,1,1,1,1,2,2,2,2,3,3,4,5;

1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,3,3,3,3,4,4,5,6;

Right border gives A001477. Row sums give A000225.

(End)

MATHEMATICA

Join[{0}, Table[Length@First@Split@IntegerDigits[n, 2], {n, 30}]] (* Birkas Gyorgy, Mar 09 2011 *) (* adapted by Vincenzo Librandi, Dec 23 2016 *)

CROSSREFS

a(n) = A007814(1+A030101(n)).

Cf. A279209, A279210.

Sequence in context: A283440 A159864 A144790 * A237453 A265754 A089309

Adjacent sequences:  A090993 A090994 A090995 * A090997 A090998 A090999

KEYWORD

base,nonn

AUTHOR

Benoit Cloitre, Feb 29 2004

EXTENSIONS

Edited and corrected by Franklin T. Adams-Watters, Apr 08 2006

Sequence had accidentally been shifted left by one step, which was corrected and term a(0)=0 added by Antti Karttunen, Jan 01 2007

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 | More pages
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy .

Last modified March 25 11:34 EDT 2017. Contains 284076 sequences.