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!)
A129972 a(n) = 2*floor(log_2(n)) + 1. 3

%I #28 Jan 17 2017 13:06:22

%S 1,3,3,5,5,5,5,7,7,7,7,7,7,7,7,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,11,11,

%T 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,

%U 11,11,11,11,11,11,11,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13

%N a(n) = 2*floor(log_2(n)) + 1.

%C The number of bits needed to write n using Elias gamma coding. - _Charles R Greathouse IV_, Mar 21 2012

%C Consists of the n-th odd number (A005408(n) = 2n+1) repeated 2^(n-1) times (since a(n) = a(n-1) except when a(n) > a(n-1) which happens for n a power of 2). - _Jonathan Vos Post_, Jun 17 2007

%H Indranil Ghosh, <a href="/A129972/b129972.txt">Table of n, a(n) for n = 1..10000</a>

%F a(n) = Sum_{k=1..n} (-1)^(k-1)*floor(n/k)*mu(k).

%o (PARI) a(n)=2*floor(log(n)/log(2))+1

%o (PARI) a(n)=log(n+.5)\log(2)*2+1 \\ _Charles R Greathouse IV_, Mar 21 2012

%o (PARI) a(n)=2*logint(n,2)+1 \\ _Charles R Greathouse IV_, Sep 04 2015

%Y Cf. A005408.

%Y Cf. A281149 (See the comment section by _Charles R Greathouse IV_, of this sequence (A129972) ). - _Indranil Ghosh_, Jan 17 2017

%K nonn,easy

%O 1,2

%A _Benoit Cloitre_, Jun 13 2007

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 18 11:52 EDT 2024. Contains 371779 sequences. (Running on oeis4.)