How to prove the in equality $b^{d-1}\le n\lt b^{d}$ 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<b^{j+1}$ for $j=0,1,2,\dots,d-1$.
But I stuck here. How can I prove the inequality?

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.
