Bit Length
The number of binary bits necessary to represent a number, given explicitly by
where 👁 [x]
is the ceiling
function, 👁 |_x_|
is the floor function, and 👁 lgn
is lg, the logarithm
to base 2. For 👁 n=0
,
1, 2, ..., the sequence of bit lengths is given by 0, 1, 2, 2, 3, 3, 3, 3, 4, 4,
4, 4, 4, 4, 4, 4, 5, 5, ... (OEIS A029837).
The function is given by the Wolfram Language
function [n].
Explore with Wolfram|Alpha
More things to try:
References
Sloane, N. J. A. Sequence A029837 in "The On-Line Encyclopedia of Integer Sequences."Referenced on Wolfram|Alpha
Bit LengthCite this as:
Weisstein, Eric W. "Bit Length." From MathWorld--A Wolfram Resource. https://mathworld.wolfram.com/BitLength.html
