2
$\begingroup$

For a positive number $n$ with base $b$, we can write

$$b^{d-1}\le n\lt b^{d},$$
where $d$ is the total number of digits in $n$. How can I prove this inequality?

Proceed:

We have $n=a_{d-1}b^{d-1}+a_{d-2}b^{d-2}+\dots+ a_1b^1+a_0b^0$, where $0\le a_i\lt b$.
$a_i\lt b\implies a_ib^j But I stuck here. How can I prove the inequality?

1 Answers 1

3

You have \begin{align} n&=a_{d-1}b^{d-1}+a_{d-2}b^{d-2}+\dots+a_1b+a_0\\ &\le (b-1)b^{d-1}+(b-1)b^{d-2}+\dots+(b-1)b+(b-1)\\ &=(b-1)(b^{d-1}+b^{d-2}+\dots+b+1)\\ &=(b-1)\frac{b^d-1}{b-1}=b^d-1 \end{align} The other inequality is obvious, because $a_{d-1}\ge1$, since the number has $d$ digits.