5

What is longer? Length of $2^n$ or number of $0$ at the end of $n!$ ? Assume that $n$ is really big, big number...

Solution

Look at terms of $2^k$: $$2,4,8,16,32,64,128,256,512,1024,2048,4096... $$ It can be seen that $$ \lfloor\frac{n}{3} \rfloor \ge length(2^n)\ge \lfloor\frac{n}{4} \rfloor $$

Now, lets look at $n!$. We know that $0$ is created at the end iif we use $2$ and $5$ or $10$. Number of $2$ is greater than number of $5$ so we can count number of $5$.

$$\mbox{number of 0 in } n! = \sum_{k \ge 0} \lfloor\frac{n}{10^k} \rfloor + \sum_{k \ge 0} \lfloor \frac{n}{5^k} \rfloor $$

$$ (n-1)\left( \sum_{k \ge 0} \frac{1}{10^k} + \sum_{k \ge 0} \frac{1}{5^k} \right)\ge \mbox{number of 0 in } n! \ge n \left( \sum_{k \ge 0} \frac{1}{10^k} + \sum_{k \ge 0} \frac{1}{5^k} \right) $$ $$ \mbox{number of 0 in } n! \approx \frac{13}{36} \cdot n \approx 0.361 \cdot n \ge \frac{1}{3} \cdot n $$

So the longer is number of $0$ in $n!$. Have I done this exercise correctly?

update

$$ (n-1)\left( \sum_{k \ge 0} \frac{1}{5^k} \right)\ge \mbox{number of 0 in } n! \ge n \left( \sum_{k \ge 0} \frac{1}{5^k} \right) $$ $$ \mbox{number of 0 in } n! \le 1/4 $$ so length of 2^n is greater that trailing $0$ in $n!$

  • You're counting the zeros only in the least significant digits? Correct? – dfnu Aug 15 '19 at 12:31
  • 2
    See also this post for the formula. You mean trailing zeroes, right? – Dietrich Burde Aug 15 '19 at 12:32
  • Yes @dfnu, it comes for the zeros at the end of $n!$ –  Aug 15 '19 at 12:33
  • Did you try any examples? $2^{30}$ has $10$ digits, but $30!$ ends in only $7$ zeroes. $2^{100}$ has $31$ digits but $100!$ ends is $24$ zeroes. – lulu Aug 15 '19 at 12:33
  • I tried @lulu and got similar results but I believe that in really big numbers, $n!$ wins, but I am not sure so I posted that here. Also $n=100$ is not a big number. I think that for big number we can consider something like $ n= 10^{10000000000000000000} $ but it also can be greater. It is realtive –  Aug 15 '19 at 12:34
  • Where do you assume large $n$ in your argument? What does the conclusion $n≥\frac 13$ mean? – lulu Aug 15 '19 at 12:35
  • 2
    It would be better to consider $\log_{10}2$ than to say, "It can be seen that ..." – saulspatz Aug 15 '19 at 12:35
  • corrected @lulu –  Aug 15 '19 at 12:38
  • Again, it's not clear where you are using the assumption of large $n$. For $n=100$ it is not true that the number of trailing zeroes in $100!$ exceeds $\frac {100}3$. I just checked $n=10^9$ and $2^n$ is still longer. It is true that the ratio of the two is declining, but I don't see how you've proven the desired claim. – lulu Aug 15 '19 at 12:42
  • An obvious upper bound on the number of trailing zeroes, $F(n)$, is given by dropping the floor function and summing the infinite geometric series. We get $F(n)≤\frac n4$. I expect that this is quite accurate for (very) large $n$. – lulu Aug 15 '19 at 12:47
  • I use assumption of large $n$ when dropping floor function –  Aug 15 '19 at 12:48
  • As I say, dropping the floor function gives you an upper bound, not a lower bound. And It gives $\frac n4$, not $\frac n3$. But the key point is that it isn't instantly clear that an upper bound helps you here. In any case, I think you have more work to do. – lulu Aug 15 '19 at 12:50
  • Did you read my solution? I wrote upper and lower bound. –  Aug 15 '19 at 12:51
  • I only read the conclusion, which says that the number of trailing zeroes in $n!$ is $≥\frac n3$. That conclusion is wrong, so I didn't look at the details. – lulu Aug 15 '19 at 12:52
  • 1
    You shouldn't separately sum over powers of 10 and powers of 5. You care about the number of times the factor 5 appears. 10 is not exactly relevant here (just like 15 and 20 are not). – Mees de Vries Aug 15 '19 at 12:58
  • Furthermore as written, you claim that $n - 1 \geq n$. But either way I think your lower bound either does not work or requires a more thorough argument. – Mees de Vries Aug 15 '19 at 12:59
  • "You shouldn't separately sum over powers of 10 and powers of 5. You care about the number of times the factor 5 appears. 10 is not exactly relevant here (just like 15 and 20 are not). " It is really helpful. I updated post. Can you look currently at that? Also, can you past that as answer? I want to mark that as the best. @MeesdeVries –  Aug 15 '19 at 13:25

1 Answers1

5

Denote by $l(n)$ the number of digits of $2^n$ and by $t(n)$ the number of trailing zeros of $n!$. We aim to show that $t(n) < l(n)$, at least for large $n$.

Per the update, the number of trailing zeros in $n!$ is the number of factors of $5$ in the prime factorization of $n!$, and it follows from the definition of factorial that this is $$t(n) = \sum_{k \geq 0} \left\lfloor\frac{n}{5^k}\right\rfloor .$$

The definition of $\lfloor \,\cdot\, \rfloor$ implies that $\lfloor m \rfloor \leq m$, so (as nearly observed in the question statement) $$t(n) \leq \sum_{k \geq 0} \frac{n}{5^k} = n \sum_{k \geq 0} \frac{1}{5^k} = \frac{1}{4} n .$$

To make rigorous the rest of the argument, we should formalize the assertion "It can be seen that..." as an inequality and then use it to show that $t(n) < l(n)$.

Hint To do this, we can use a familiar formula $$l(n) = \lfloor \log_{10} (2^n) \rfloor + 1 = \lfloor n \log_{10} 2 \rfloor + 1 .$$ The definition of $\lfloor \,\cdot\, \rfloor$ implies that $m \leq \lfloor m \rfloor + 1$, immediately giving the lower bound $$(\log_{10} 2) n \leq l(n) .$$

Comparing our bounds, we can see that if we can show $$\phantom{(\ast)} \qquad \frac{1}{4} < \log_{10} 2 , \qquad (\ast)$$ then we will have $$t(n) \leq \frac{1}{4} n < (\log_{10} 2) n \leq l(n)$$ as desired (in fact, for all $n > 0$, not just large $n$). But some algebraic rearrangement shows that $(\ast)$ is equivalent to $10 < 16$.

Travis Willse
  • 99,363
  • Yeah, that’s the answer! If you guys don’t know why is $\dfrac{1}{4}<\log_{10} 2$ equivalent to $10<16$, I will show you guys. Firstly, we take $\log_{10}$ both side of $10<16$ and get $1<\log_{10}{16}$. Observe that $\log_{10}{16}=4\log_{10} 2$. Then, divide both sides by 4 and we’ll get $\dfrac{1}{4}<\log_{10} 2$ – MafPrivate Aug 15 '19 at 14:26
  • 1
    @IsaacYIUMathStudio Thanks for the elaboration. It's not true for all number bases $b$, by the way, that the number $t(n)$ of trailing zeros of $n!$ in base $b$ is smaller (for large $n$) than the number $l(n)$ of base-$b$ digits of $2^n$. For example, in base $6$, $t(n) = \frac{1}{2} n + o(n)$ but $l(n) = (\log_6 2) n + o(n)$, and $\log_6 2 = 0.38685\ldots < \frac{1}{2}$. A problem you might find interesting is to find the base for which this case is the most extreme, that is, find the base for which the limiting value $\lim_{n \to \infty} \frac{t(n) - l(n)}{n}$ is the largest. – Travis Willse Aug 15 '19 at 15:35