The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation.

 Hints (Greetings from The On-Line Encyclopedia of Integer Sequences!)
 A129972 a(n) = 2*floor(log_2(n)) + 1. 3
 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, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13 (list; graph; refs; listen; history; text; internal format)
 OFFSET 1,2 COMMENTS The number of bits needed to write n using Elias gamma coding. - Charles R Greathouse IV, Mar 21 2012 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 LINKS Indranil Ghosh, Table of n, a(n) for n = 1..10000 FORMULA a(n) = Sum_{k=1..n} (-1)^(k-1)*floor(n/k)*mu(k). PROG (PARI) a(n)=2*floor(log(n)/log(2))+1 (PARI) a(n)=log(n+.5)\log(2)*2+1 \\ Charles R Greathouse IV, Mar 21 2012 (PARI) a(n)=2*logint(n, 2)+1 \\ Charles R Greathouse IV, Sep 04 2015 CROSSREFS Cf. A005408. Cf. A281149 (See the comment section by Charles R Greathouse IV, of this sequence (A129972) ). - Indranil Ghosh, Jan 17 2017 Sequence in context: A133772 A265182 A251549 * A130829 A196386 A035158 Adjacent sequences:  A129969 A129970 A129971 * A129973 A129974 A129975 KEYWORD nonn,easy AUTHOR Benoit Cloitre, Jun 13 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
The OEIS Community | Maintained by The OEIS Foundation Inc.

Last modified April 6 16:14 EDT 2020. Contains 333276 sequences. (Running on oeis4.)