1

I would like to derive the first $n$ such that (The number of trailing zeros in $n!$) $\geq z$, given $z$.

According to this answer, we can estimate $n$ by $4z$. He explains the reason as follows.

To get a very good estimate, note that the number of trailing $0$'s is $$\left\lfloor \frac{n}{5}\right\rfloor+ \left\lfloor \frac{n}{5^2}\right\rfloor+ \left\lfloor \frac{n}{5^3}\right\rfloor+\cdots.$$ This is less than the infinite sum $$\frac{n}{5}+\frac{n}{5^2}+\frac{n}{5^3}+\cdots.$$ The infinite geometric series has sum $\frac{n}{4}$. So if we want $z$ trailing zeros, then $n \gt 4z$. A computation using $4z$ will tell us how much we need to go forward from $4z$. The difference between $\frac{n}{5^k}$ and $\left\lfloor \frac{n}{5^k}\right\rfloor$ is always less than $1$. So the amount we may need to go forward to find the appropriate $n$ (if there are any) is logarithmic in $z$.

(Emphasis mine)

I don't understand the highlighted part here.

  1. What does "The amount ... is logarithmic in $z$ " exactly mean? Does it mean that $\lim_{z\to \infty} (\text{A function of }z)/\log{z} \to 1$? Still, I don't know what is supposed to be in the numerator.
  2. How does it follow from "The difference ... is always less than 1"?

I thought I would comment on the original answer, but the answerer does not seem to be active anymore.

Kaira
  • 1,451
  • 3
    The number of zeros is $$ \sum\limits_{k=1}^{\left\lceil \log_5 n \right\rceil } {\left\lfloor \frac{n}{{5^k }} \right\rfloor } $$ and the difference between this and the approximation is $$0\le \sum\limits_{k = 1}^{\left\lceil {\log 5 n} \right\rceil } {\frac{n}{{5^k }}} - \sum\limits{k = 1}^{\left\lceil \log 5 n \right\rceil } {\left\lfloor {\frac{n}{{5^k }}} \right\rfloor } < \sum\limits{k = 1}^{\left\lceil \log _5 n \right\rceil } 1 = \left\lceil \log _5 n\right\rceil $$ which is logarithmic in $n$ or in $z \approx n/4$. Note that $0\leq x - \left\lfloor x \right\rfloor < 1$. – Gary Jun 25 '21 at 13:50
  • Note that the terms with $5^k > n$, which appear in the infinite sum over $n/5^k$ but not in the truncated sum over the floors, give an additional correction no larger than $5/4$. So strictly speaking the error is $< \lfloor \log_5 n\rfloor + 5/4$... this bound is approached when $n$ is just under a power of $5$. – mjqxxxx Jun 25 '21 at 15:09
  • @PaulSinclair your comment seems poorly edited. – Spectre Jun 26 '21 at 07:59
  • @Spectre - I was rushing to leave at the time. Here is the correction: What they say is always less than 1 is the difference berween $\frac n{5^k}$ and $\left\lfloor\frac n{5^k}\right\rfloor$, and that is just because $\lfloor x\rfloor≤x<\lfloor x\rfloor+1$ by definition. And to say a function $f(z)$ is logarithmic (in growth) means that $\lim sup_{z\to \infty}\frac{f(z)}{\log z}$ is finite and not $0$. – Paul Sinclair Jun 26 '21 at 13:17
  • @PaulSinclair no problem... I only told you that the user must have found it hard to read :D... – Spectre Jun 26 '21 at 15:51

0 Answers0