I (as a teacher) saw in a book for $8^{th}$ grade students that the number of trailing zeroes of ${n!}\times{m!}$ is the sum of the trailing zeroes of $n!$ and $m!$. There also has been noticed that the number of trailing zeroes of $\dfrac{n!}{m!}$ ($m<n$) is their subtraction. i.e.
$$(\left\lfloor \frac{n}{5}\right\rfloor+ \left\lfloor \frac{n}{5^2}\right\rfloor+ \left\lfloor \frac{n}{5^3}\right\rfloor+\cdots)-(\left\lfloor \frac{m}{5}\right\rfloor+ \left\lfloor \frac{m}{5^2}\right\rfloor+ \left\lfloor \frac{m}{5^3}\right\rfloor+\cdots).$$
But I think this is wrong because for example $\dfrac{15!}{14!}=15$ but $3-2=1$.
Can one prove that this statement is correct if $n>m-1$? If so why this restriction is necessary?
Of course it is obvious that $\dfrac{(n+1)!}{n!}=n+1$ and the number of trailing zeroes depend on the number of trailing zeroes of the number $n+1$.
Where does this strange behavior comes from? i.e. in product of factorials we sum number of trailing zeroes but in division we should care about it?
Note: I always make mistakes in simple math calculations. Am I wrong here?
The formula will be wrong lots of times. For example, $125!/122!$ has two trailing $0$’s, while the formula suggests $3$. The problem is that there are more $5$’s in the factorization than $2$’s.
If you calculate the corresponding formula for $2$ and take the minimum of the two values, you’ll correct the formula.
The formula that is stated counts the number of $5$'s in the factorization of the quotient $\frac{n!}{m!}$. Usually, in factorials, $5$ is scarcer than $2$. In the quotient, however, it is possible that $2$ becomes rarer. Therefore, if you take the formula that counts the number of $2$'s, you'll see that, for example, $\frac{15!}{14!}$ has $(7+3+1)-(7+3+1)=0$ factors of $2$, so it has no trailing $0$'s.