For positive integer $n$, why is $\lfloor \log_{10}(2^n)\rfloor + \lfloor \log_{10}(5^n)\rfloor + 2 = n+1$?

118 Views Asked by At

For positive integer $n$, why is $\lfloor \log_{10}(2^n)\rfloor + \lfloor \log_{10}(5^n)\rfloor + 2 = n+1$?

This question comes from counting the number of digits of $10^n$ in terms of the number of digits of $2^n$ and $5^n$. Number of digits of $10^n$ is $n+1$ which equals to the sum of the number of digits of $2^n$ and $5^n$. I know that the number of digits of a positive integer $x$ is $\lfloor \log_{10}(x)\rfloor + 1$.

Using programming, I've checked that this is true for $n$ less than $100$.

4

There are 4 best solutions below

0
On BEST ANSWER

$\lfloor{\log_{10}(2^n)}\rfloor = \lfloor{\log_{10}(10^n) - \log_{10}(5^n)}\rfloor = n + \lfloor{ - \log_{10}(5^n)}\rfloor = n - \lfloor{\log_{10}(5^n)}\rfloor - 1$

So:

$\lfloor{\log_{10}(2^n)}\rfloor + \lfloor{\log_{10}(5^n)}\rfloor + 2 = n - \lfloor{\log_{10}(5^n)}\rfloor - 1 + \lfloor{\log_{10}(5^n)}\rfloor + 2 = n + 1$

0
On

Consider $\lfloor n\log_{10}2\rfloor+\lfloor n\log_{10}5\rfloor+1$. Since $\log_{10}2$ and $\log_{10}5$ are irrational we can replace each floor by a ceiling and a $-1$, i.e. it is equal to $$\lceil n\log_{10}2\rceil+\lceil n\log_{10}5\rceil-1$$ Now we have the following inequalities for any $x,y$: $$\lfloor x+y\rfloor\le\lfloor x\rfloor+\lfloor y\rfloor+1$$ $$\lceil x\rceil+\lceil y\rceil-1\le\lceil x+y\rceil$$ This bounds $\lfloor n\log_{10}2\rfloor+\lfloor n\log_{10}5\rfloor+1$ from below by $\lfloor n(\log_{10}2+\log_{10}5)\rfloor=n$ and from above by $\lceil n(\log_{10}2+\log_{10}5)\rceil=n$, so $$\lfloor n\log_{10}2\rfloor+\lfloor n\log_{10}5\rfloor+1=n\ \forall n\in\mathbb Z^+$$ Putting the multipliers $n$ in the logs and adding $1$ to both sides gives the desired identity.

0
On

We can first do the steps that are obvious: rearranging. This would give us $\left \lfloor{\log_{10}(2^n)}\right \rfloor+\left \lfloor{\log_{10}(5^n)}\right \rfloor=n-1$. Using logrithm properties, we can simplify that to $\left \lfloor{n\log_{10}(2)}\right \rfloor+\left \lfloor{n\log_{10}(5)}\right \rfloor=n-1$.

Let's first consider something easier, without the floor function. That would bring up this equation: $n\log_{10}(2)+n\log_{10}(5)=n\log_{10}(2\cdot5)=n\log_{10}(10)=n$.

Let's get back to our original problem. We can first estimate the constant terms. $\log_{10}(2)\approx0.3010$ and $\log_{10}(5)\approx1-0.3010=0.6970$. Since both of the numbers are irrational, any positive integer $n$ multiplied by that would still result in an irrational number. Thus, both of the terms in the floor functions are not integers.

The floor function gets rid of the decimal part of a number, thus, it can subtract less than $2$ with two floor functions added. ($(0.999+0.999)-(\left \lfloor{0.999}\right \rfloor+\left \lfloor{0.999}\right \rfloor)<2$). Since they are both irrational, the floor function cannot subtract $0$ either. Thus, $$n-2<\left \lfloor{\log_{10}(2^n)}\right \rfloor+\left \lfloor{\log_{10}(5^n)}\right \rfloor<n\textrm{ and }n\in\mathbb{Z}^+$$ Therefore, we get that $\left \lfloor{\log_{10}(2^n)}\right \rfloor+\left \lfloor{\log_{10}(5^n)}\right \rfloor+2=n+1$.

0
On

There is a slightly more general result:

Claim 1: Let $a$ and $b$ be 2 positive nonintegral reals satisfying $a+b=n$ for some natural number $n$. Then $$\lfloor a \rfloor + \lfloor b\rfloor =n-1.$$

To see this, note that as $a+b$ is integral, it follows that $(a-\lfloor a \rfloor) + (b-\lfloor b \rfloor)$ must also be integral, and as $a$ and $b$ are each not integral, it follows that each of $(a-\lfloor a \rfloor)$, $(b -\lfloor b \rfloor)$ must be strictly between $0$ and $1$, and so the sum must be strictly between $0$ and $2$. So as this sum still must be integral, it follows that this sum must be $1$, which gives $$(a-\lfloor a \rfloor) + (b-\lfloor b \rfloor) =1,$$ and therefore $$\lfloor a \rfloor + \lfloor b \rfloor = (a+b)-1=n-1.$$ $\surd$

So let $a \doteq \log_{10}(2^n)$ and $b\doteq \log_{10}(5^n)$; $n$ integral, note that $a$ and $b$ are each nonintegral [why is that] and $$a+b = \log_{10}(5^n)+\log_{10}(2^n) =\log_{10}10^n = n.$$

Can you finish then using Claim 1?