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!)
A004257 a(n) = round(log_2(n)). 7

%I #41 Sep 08 2022 08:44:32

%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 | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 16 07:08 EDT 2024. Contains 371698 sequences. (Running on oeis4.)