Find the number of trailing zeros of $\binom{2020}{1234}$ Find the number of trailing zeros of $\binom{2020}{1234}$.
I first got the number of trailing zeros of $2020!$, $786!$, and $1234!$, which are $503$, $195$, and $305$. I added the second and the third and I subtracted from the first and gave me $3$, but the correct answer was $2$.
 A: Given a prime $p$, we know that $p^m\lVert k!$ for $m=\sum_{j=1}^\infty\left\lfloor \frac{k}{p^j}\right\rfloor$.
Thus \begin{align}2020!&=2^{2013}\cdot 5^{503} a\\ 1234!&=2^{1229}\cdot 5^{305} b\\ 786!&=2^{782}\cdot 5^{195} c\end{align}
With $a,b,c$ coprime with $10$ and such that $\frac a{bc}\in\Bbb N$. Therefore $$\binom{2020}{1234}=2^{2013-1229-782}\cdot 5^{503-305-195}\frac{a}{bc}=2^2\cdot 5^3\cdot\frac a{bc}=10^2\cdot \frac{5 a}{bc}$$
and $\frac{5a}{bc}$ is odd.
Basically, the point is that $\max(x,y)-\max(z,w)$ needs not be larger than $\min(x,y)-\min(z,w)$, therefore one cannot focus only on the exponent of $5$.
A: According to Kummer’s theorem, the binomial coefficient $\binom nk$ contains exactly as many factors of a prime $p$ as carries arise in the digital addition of $m$ and $n-m$ in base $p$.
In the present case, we have $n=2020$, $m=1234$, thus $n-m=786$, and
\begin{eqnarray}
1234_{10}&=&14414_5\;,\\
786_{10}&=&11121_5\;,\\
2020_{10}&=&11111100100_2\;,\\
786_{10}&=&\hphantom{0}1100010010_2\;.
\end{eqnarray}
So there are $3$ carries in the addition in base $5$ and $2$ carries in the addition in base $2$, and thus exactly $2$ factors of $10$ in the coefficient.
The error in your calculation was the assumption that the counts of the composite factor $10$ can be added and subtracted like the counts of prime factors. The number of factors of $10$ in a number is the minimum of the numbers of factors of $2$ and $5$, and this minimum is not additive.
