# Zeros at the end of sum of factorials

Find the number of zeros at the end of $$15! + 16! + 17! + 18!$$ ? I know the method find the number of zeros at the end of x! where $$x = { 15! , 16! , 17! ...}$$ by dividing by number by $$5,5^2, 5^3$$ and so on .

• This will be that except that you're calculating $15!(1+16+16\cdot17+16\cdot17\cdot18)$,
– user694818
Commented Sep 8, 2019 at 12:02
• Wolframalpha tells me it ends in $4$ zeroes. Commented Sep 8, 2019 at 12:08
• yes ,It ends in 4 zeros .But can you tell me any optimized way of finding it Commented Sep 8, 2019 at 12:10

$$1+16+16 \cdot 17+ 16 \cdot 17 \cdot 18 = 5185$$. If the first non-zero digit of $$15!$$ is odd, then there will be just $$3$$ zeroes at the end from the $$15!$$. However, if it is even, there will be exactly one more zero. (hint: look at integers from $$1$$ to $$9$$)

Then we have to find:

$$1 \cdot 2 \cdot 3 \cdot 4 \cdot 6 \cdot 7 \cdot 8 \cdot 9 \cdot 11 \cdot 12 \cdot 13 \cdot 14 \pmod {10}$$

and the result is an even number.

• You mean to have $\pmod{1000}$? Commented Sep 8, 2019 at 13:34
• No, just $\pmod {10}$. This is just the same as the last non-zero digit of $15! \pmod {10 \ 000}$. Commented Sep 8, 2019 at 13:36
• Ah my bad :p ${}$ Commented Sep 8, 2019 at 13:37

First divide $$15!$$ by $$10^3$$ (in the obvious way, from its expression) to determine its last nonzero digit. Hopefully, it will be the 4th digit from the right. You're left with $$N=3\cdot 4\cdot 6\cdot 7\cdot 8\cdot 9\cdot 11\cdot 12\cdot 13\cdot 7\cdot 3= 2^8\cdot 3^6\cdot 7^2\cdot 11\cdot 13$$ Modulo $$100$$, we have $$N\equiv 56\cdot 29\cdot 49\cdot 43=56\cdot 29\cdot (50-1)(40+3)\equiv 56\cdot 29\cdot 7\equiv 56\cdot 3\equiv 68$$ As a conclusion, $$\; 15!\equiv 68\,000\mod 10^5$$.

Now we'll compute: \begin{align}M&=1+16+16\cdot 17+16\cdot 17\cdot 18=17^2+16\cdot 17\cdot 18=17(17+17^2-1)\\ &= 17(17+289-1)=17\cdot 305=5185 \end{align}

Thus, $$15!+16!+17!+18!\equiv68\,000\cdot 5185\equiv 8000\cdot 85=680\,000\equiv \color{red}{ 80000} \mod 10^5.$$