Let $n$ be a positive integer. Then the length $\ell(n)$ of $n$, that is, the number of digits in the decimal representation of $n$, is given by $$\ell(n) = \lfloor \log_{10}(n)\rfloor + 1.$$ How can one go about rigorously proving that this holds for all positive integers?
Asked
Active
Viewed 139 times
0
-
https://math.stackexchange.com/questions/231742/proof-how-many-digits-does-a-number-have-lfloor-log-10-n-rfloor-1?rq=1 – Enrico M. Nov 21 '17 at 19:25
-
- Use division algorithm to prove that for any $n$ there is a unique set of $(a_0,.... a_m)$ so that $a_i$ is a integer between 0 and 9 and $a_m \ne 0$ and $n = \sum a_i*10^i$. 2) By definition, $n$ has $m+1$ digits. 3) Note $10^m \le n < 10^{m+1}$ so $m \le \log_{10} n \le m+1$. 4) That's all. 1) is the rigorous but straightforward part.
– fleablood Nov 21 '17 at 19:35 -
To be fair, none of the answers on the original page are "rigorous". However I want to point out that proving the number of digits is $[\log_{10} n] + 1$ is trivial. The hypothesis requiring rigor is actually not that, but that all positive integers can actually be expressed uniquely as a base 10 numeral with a specific and distinct number of digits.... although "rigor" is a relative term. Archemediam property proves the division thereom, and the division th. and induction prove decimal notation is valid. – fleablood Nov 21 '17 at 19:41
-
Archemedian Property says for any real $M$ and any $y > 0$ there is a unique integer $n$ so that $ny \le M < (n+1)y$ and as a consequence. $0\le M-ny < y$. Use induction with $y=10^k$ for integer values of $k$ recursively, and that proves that all positive integers have a unique base 10 representation with a specific number of digits. If $m$ is that number $10^m \le n <10^{m+1}$ and taking logs, completes the proof. – fleablood Nov 21 '17 at 19:50
-
And there are several ways to prove the Archemdian Property. Leting ${n|ny \le M; n\in \mathbb Z}$ is bounded above by $M/y$ so least upper bound exists, must be an integer, and the sup satisfies and is the solution, is probably the best. – fleablood Nov 21 '17 at 19:54