Home

floorlog23

Floorlog23 is the floor of the logarithm with base 23 for a positive real input. Formally, floorlog23(x) = floor(log_23(x)) for x > 0. The range consists of the nonnegative integers, and the function is undefined for x ≤ 0. It increases in a stepwise fashion, with jumps at powers of 23.

For integers, floorlog23(n) = k if and only if 23^k ≤ n < 23^{k+1}. Equivalently, floorlog23(n) gives the number

Computation is straightforward with standard logarithms: floorlog23(x) = floor(ln x / ln 23) or floor(log10 x / log10 23).

Examples: floorlog23(1) = 0, floorlog23(22) = 0, floorlog23(23) = 1, floorlog23(528) = 2, floorlog23(529) = 2, and floorlog23(12167) = 3, since

Applications of floorlog23 include determining the number of digits of a number in base 23, estimating sizes

of
base-23
digit
positions
minus
one.
In
this
sense,
the
base-23
representation
of
n
has
floorlog23(n)
+
1
digits.
The
function
is
monotone
nondecreasing
and
changes
value
only
when
n
crosses
a
power
of
23.
For
integer
inputs,
an
efficient
approach
is
to
compare
n
with
successive
powers
of
23
or
to
use
a
logarithm
function
as
above
to
obtain
the
result.
23^3
=
12167.
in
algorithms
that
operate
on
base-23
representations,
and
related
analyses
in
number
theory
and
computer
science.
It
is
closely
related
to
the
general
floor
of
a
logarithm
base
b,
with
floorlog_b(n)
equaling
the
digit-length
minus
one
in
base
b.