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
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, 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, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,3
LINKS
FORMULA
a(n) = floor(log_2(sqrt(2)*n)). - Velin Yanev, Dec 11 2016
a(n) = A000523(n^2) - A000523(n). - Mikhail Kurkov, Sep 11 2019 [verification needed]
MATHEMATICA
Round[Log[2, Range[90]]] (* Harvey P. Dale, Aug 26 2014 *)
PROG
(PARI) a(n) = round(log(n)/log(2)); \\ Michel Marcus, Dec 11 2016
(PARI) a(n) = {logint(n^2, 2) - logint(n, 2)} \\ Andrew Howroyd, Sep 11 2019
(Magma) [Round(Log(2, n)):n in [1..90]]; // Marius A. Burtea, Aug 02 2019
CROSSREFS
Cf. A000523 (floored).
Sequence in context: A227923 A346425 A029836 * A360010 A276611 A238598
KEYWORD
nonn,changed
AUTHOR
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 24 22:17 EDT 2024. Contains 371964 sequences. (Running on oeis4.)