|
| |
|
|
A090996
|
|
Number of leading 1's in binary expansion of n.
|
|
2
| |
|
|
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; internal format)
|
|
|
|
OFFSET
| 0,4
|
|
|
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
|
|
|
EXAMPLE
| In binary : 14=1110 and there are 3 leading 1's, so a(14)=3.
|
|
|
MATHEMATICA
| Table[Length@First@Split@IntegerDigits[n, 2], {n, 30}] (* Gyorgy Birkas, Mar 9 2011 *)
|
|
|
CROSSREFS
| a(n) = A007814(1+A030101(n)).
Sequence in context: A136256 A159864 A144790 * A089309 A126387 A038374
Adjacent sequences: A090993 A090994 A090995 * A090997 A090998 A090999
|
|
|
KEYWORD
| base,nonn
|
|
|
AUTHOR
| Benoit Cloitre (benoit7848c(AT)orange.fr), Feb 29 2004
|
|
|
EXTENSIONS
| Edited and corrected by Frank Adams-Watters (FrankTAW(AT)Netscape.net), Apr 08 2006. Sequence had accidentally been shifted left by one step, which was corrected and term a(0)=0 added by Antti Karttunen (His-Firstname.His-Surname(AT)gmail.com), Jan 01 2007.
|
| |
|
|