The number of binary bits necessary to represent a number, given explicitly by
(1)
| |||
(2)
|
where is the ceiling
function,
is the floor function, and
is lg, the logarithm
to base 2. For
,
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 BitLength[n].