Number Theory – Showing Two Numbers Have the Same Number of Digits

ceiling-and-floor-functionselementary-number-theorylogarithmsself-learning

I want to show that for $n>0$, $2^n$ and $2^n + 1$ have the same number of digits.

What I did was I found that the formula for the number of digits of a number $x$ is $\left \lfloor{\log_{10}(x)}\right \rfloor + 1$, so basically if I subtract that formula with $x = 2^n$ with the formula with $x = 2^n + 1$, I should get zero.

$\left \lfloor{\log_{10}(2^n)}\right \rfloor + 1 – (\left \lfloor{\log_{10}(2^n + 1)}\right \rfloor + 1) = \left \lfloor{\log_{10}(2^n)}\right \rfloor -\left \lfloor{\log_{10}(2^n + 1)}\right \rfloor $.

At this point, I don't know of a way to simplify this any further to make it equal $0$. I thought about mentioning that $\log_{10}(x)$ increases slower than $x$ as $x$ increases, which would mean the difference of the floor of the logs of two consecutive numbers may be close to zero, but that doesn't cut it to prove that $2^n, 2^n + 1$ have exactly the same number of digits.

Are there any special floor or log properties I could use to make this easier? Any help is appreciated.

Best Answer

Note the only way $2^n+1$ can have one more digit than $2^n$ is if $2^n$ ended in a $9$ (actually ends is $\cdots 999999$ but that is not important). $2^n$ can never end in a $9$.

Related Question