This site is supported by donations to The OEIS Foundation.

 Please make a donation to keep the OEIS running. We are now in our 55th year. In the past year we added 12000 new sequences and reached 8000 citations (which often say "discovered thanks to the OEIS"). We need to raise money to hire someone to manage submissions, which would reduce the load on our editors and speed up editing. Other ways to donate

 Hints (Greetings from The On-Line Encyclopedia of Integer Sequences!)
 A004257 a(n) = round(log_2(n)). 7

%I

%S 0,1,2,2,2,3,3,3,3,3,3,4,4,4,4,4,4,4,4,4,4,4,5,5,5,5,5,5,5,5,5,5,5,5,

%T 5,5,5,5,5,5,5,5,5,5,5,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,

%U 6,6,6,6,6,6,6,6,6,6,6,6,6

%N a(n) = round(log_2(n)).

%H T. D. Noe, <a href="/A004257/b004257.txt">Table of n, a(n) for n = 1..10000</a>

%F a(n) = floor(log_2(sqrt(2)*n)). - _Velin Yanev_, Dec 11 2016

%F a(n) = A000523(n^2) - A000523(n). - _Mikhail Kurkov_, Sep 11 2019

%t Round[Log[2,Range[90]]] (* _Harvey P. Dale_, Aug 26 2014 *)

%o (PARI) a(n) = round(log(n)/log(2)); \\ _Michel Marcus_, Dec 11 2016

%o (PARI) a(n) = {logint(n^2,2) - logint(n,2)} \\ _Andrew Howroyd_, Sep 11 2019

%o (MAGMA) [Round(Log(2,n)):n in [1..90]]; // _Marius A. Burtea_, Aug 02 2019

%Y Cf. A000523 (floored).

%K nonn

%O 1,3

%A _N. J. A. Sloane_

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 December 7 05:14 EST 2019. Contains 329839 sequences. (Running on oeis4.)