The cost of representing a number
N in a given base
b can be defined as : E(b,N) = b \lfloor \log_b (N) +1 \rfloor \, where we use the
floor function \lfloor \rfloor and the base-b
logarithm \log_{b}. If both
b and
N are positive integers, then the quantity E(b,N) is equal to the number of
digits needed to express the number
N in base
b, multiplied by base
b. This quantity thus measures the cost of storing or processing the number
N in base
b if the cost of each "digit" is proportional to
b. A base with a lower average E(b,N) is therefore, in some senses, more efficient than a base with a higher average value. For example,
100 in
decimal has three digits, so its cost of representation is 10×3 = 30, while its binary representation has seven digits (11001002), so the analogous calculation gives 2×7 = 14. Likewise, in
base 3 its representation has five digits (102013), for a value of 3×5 = 15, and in base 36 (2S36) one finds 36×2 = 72. If the number is imagined to be represented by a
combination lock or a
tally counter, in which each wheel has
b digit faces, from 0, 1, ..., b-1 and having \lfloor \log_b (N) +1 \rfloor wheels, then E(b,N) is the total number of digit faces needed to inclusively represent any integer from 0 to
N. ==Asymptotic behavior==