# Two questions on finding trailing digits in (large) numbers and one on divisibility

Without using a calculator, how can we solve the following?

1. How do we find the number of zeros at the end of $600!$
2. What are the last 3-digits of $171^{172}$?
3. What is the sum of all positive numbers less than or equal to $61$, which are divisible by $3$ as well as by $5$?

HINTS:

1) The number of zeroes at the end of the decimal expansion of the natural number $N$ is $k$ if and only if $10^k$ divides $N$ but $10^{k+1}$ does not.

Thus, if you want to know how many zeroes does $600!=600\cdot599\cdot598\cdot\dots\cdot3\cdot2\cdot1$ end with, you need to compute the factors $10$. Since $10=2\cdot5$ and $2<5$ that's the same as counting the factors of $5$ of which there is one every $5$ numbers. But that's not the entire story: the number $25=5^2$ gives so far only a contribution of $1$ to the count, whereas it contains two factors $5$. Thus in order to get the correct answer you need to ...

2) You want $171^{172}\bmod 1000$. Note that $$171^{172}\equiv(171^2)^{86}\equiv241^{86}\equiv(241^2)^{43} \equiv81^{32+8+2+1}\equiv81^{32}81^881^281\equiv\cdots.$$ Keep going.

3) A number is divisible by $3$ and $5$ if and only if it is divisible by $15$. Thus, what are the summands less than $61$?

• ! could you explain the all questions by more detail please... – gama Nov 12 '12 at 10:16
• gama, do you have anything to contribute, at all? – Gerry Myerson Nov 12 '12 at 11:41
• I added some detail, but you should really work out the rest by yourself – Andrea Mori Nov 12 '12 at 11:54
• @QAndrea Mori!Thank you so much for your explanation. – gama Nov 14 '12 at 6:17