login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A070941 Length of binary representation of 2n+1. 22
1, 2, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8 (list; graph; refs; listen; history; text; internal format)
OFFSET
0,2
COMMENTS
Sequence consists of A011782(n) n+1's. - Jon Perry, Apr 04 2004
For n > 0: a(n) = A003314(n+1) - A003314(n) = A123753(n) - A123753(n-1). - Reinhard Zumkeller, Oct 12 2006
For k >= 2, k appears 2^(k-2) times consecutively. - Bernard Schott, Jun 08 2019
Also length of binary representation of 2n. - Michel Marcus, Oct 28 2020
LINKS
FORMULA
Let b(1)=1, b(n) = a(n-floor(n/2)) + 1, then a(n) = b(n+1). - Benoit Cloitre, Oct 23 2002
G.f.: 1/(1-x) * (1 + Sum_{k>=0} x^2^k). - Ralf Stephan, Apr 15 2002
a(n) = ceiling(log_2(n+1)) + 1 = A029837(n+1) + 1. - Ralf Stephan, Apr 15 2002
a(n) = ceiling(average of previous entries) + 1. - Jon Perry, Apr 04 2004
MATHEMATICA
Table[IntegerLength[n, 2], {n, 1, 201, 2}] (* Harvey P. Dale, May 17 2011 *)
PROG
(PARI) a(n)=length(binary(2*n+1))
(Python)
def A070941(n): return n.bit_length()+1 # Chai Wah Wu, Mar 29 2023
CROSSREFS
Bisection of A070939 and also of A070940.
Sequence in context: A303660 A290021 A348020 * A061775 A356384 A225634
KEYWORD
nonn
AUTHOR
N. J. A. Sloane, May 18 2002
STATUS
approved

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

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 23 11:35 EDT 2024. Contains 371912 sequences. (Running on oeis4.)