Find the smallest integer n such that the expression $40! \cdot 5^n$ has the maximum number of trailing zeros.

105 Views Asked by At

Find the smallest integer n such that the expression $$40! \cdot 5^n$$ has the maximum number of trailing zeros.

2

There are 2 best solutions below

0
On

Hint: Legendre's theorem can be used to find the largest powers of $2$ and of $5$ that divide $40!$.

0
On

Basically, you need to count the number of factors $2$ and $5$ in the factorial $40!$: $$\begin{align}40!&=\color{red}1\cdot 2\cdot \color{red}3\cdot 4\cdot \color{red}5\cdots 38\cdot \color{red}{39}\cdot 40=\\ &=2^{20}\cdot (\color{blue}1\cdot 2\cdot \color{blue}3\cdots \color{blue}{19}\cdot 20)\cdot (\color{red}1\cdot \color{red}3\cdot \color{red}5\cdots \color{red}{37}\cdot \color{red}{39})=\\ &=2^{20}\cdot 2^{10}\cdot (1\cdot 2\cdot 3\cdots 9\cdot 10)\cdot (\color{blue}1\cdot \color{blue}3\cdots \color{blue}{19})\cdot (1\cdot 3\cdot 5\cdots 37\cdot 39)=\\ &=2^{20}\cdot 2^{10}\cdot 2^5\cdot (1\cdot 2\cdot 3\cdot 4\cdot 5)\cdot (1\cdot 3\cdots 9)\cdot (1\cdot 3\cdots 19)\cdot (1\cdot 3\cdot 5\cdots 37\cdot 39)=\\ &=2^{20}\cdot 2^{10}\cdot 2^5\cdot 2^3\cdot (1\cdot 3\cdot 5)\cdot (1\cdots 9)\cdot (1\cdots 19)\cdot (1\cdots 39)=\\ &=2^{38}\cdot (5A)\cdot (5B)\cdot (5^2C)\cdot (5^5D)=\\ &=2^{38}\cdot 5^9E. \end{align}$$ Hence, the minimum $n$ in $40!\cdot 5^n$ is: $38=9+n\Rightarrow n=29$.