Question Number 10040 by FilupSmith last updated on 21/Jan/17
$$\mathrm{Show}\:\mathrm{that} \\ $$$$\lfloor\mathrm{log}_{\mathrm{10}} \left({x}\right)+\mathrm{1}\rfloor\:\:\:\mathrm{give}\:\mathrm{the}\:\mathrm{number}\:\mathrm{of} \\ $$$$\mathrm{digits}\:\mathrm{for}\:{x}\in\mathbb{Z} \\ $$
Answered by mrW1 last updated on 21/Jan/17
$${let}\:{x}\:{be}\:{an}\:{integer}\:{with}\:{n}\:{digits},\:{then} \\ $$$$\mathrm{10}^{{n}−\mathrm{1}} \leqslant{x}<\mathrm{10}^{{n}} \\ $$$$\mathrm{log}_{\mathrm{10}} \:\mathrm{10}^{{n}−\mathrm{1}} \leqslant\mathrm{log}_{\mathrm{10}} \:\left({x}\right)<\mathrm{log}_{\mathrm{10}} \:\mathrm{10}^{{n}} \\ $$$${n}−\mathrm{1}\leqslant\mathrm{log}_{\mathrm{10}} \:\left({x}\right)<{n} \\ $$$${n}\leqslant\mathrm{log}_{\mathrm{10}} \:\left({x}\right)+\mathrm{1}<{n}+\mathrm{1} \\ $$$$\Rightarrow\lfloor\mathrm{log}_{\mathrm{10}} \:\left({x}\right)+\mathrm{1}\rfloor={n} \\ $$