If you want to know the number of times the exprssion 'x' is divisible by 'a' you need to find a's prime factors and count the times x is divisible by each one of them.
You probably have no idea what im talking about so ill give an example:
Lets see how many times 9! Is divisible by 3.
3's only prime factor is 3. So we need to count the times 9! Is divisible by 3.
There are 3 numbers that are divisible by 3 and arent bigger than 9: 3, 6, 9. 3 is divisible by 3 once, 6 is divisible by 3 once and 9 is divisible by 3 twice. 1+1+2=4. So 9! Is divisible by 3 4 times.
But 3 is a prime and he has only one prime factor. Lets see what happens when we have more that one factor shall we?
Lets take 6. 6's prime factors are 3 (once) and 2 (once).
The new question is how many times is 12! Divisible by 6?
The first thing we have to do is count the times 12! Is divisible by 2. Im too lazy so i wont write the whole process again. The answer is 10. For 3, the answer is 5.
BUT WE GOT 2 DIFFERENT ANSWERS W*F WHAT SHOULD WE DO??!???!11!?!
Well, we need to pick the smaller number, which is 5. Why? Lets think about it in a different way. We got 3^5 and 2^10. We need to count the times 3^5*2^10 is divisible by 6.
3^5*2^10=(2*3)^5*2^5. We dont care about the 2^5 that got out because it is not divisible by 3, therefore not divisible by 6
So the answer is 5.
Do you know how to answer your question now?
Here is a "Rule of Thumb" when trying to find the number of trailing zero of a large factorial:
Example: How many trailing zeros are there in 5,000! ???.
You simply divide the number in question by "powers of 5", as follows:
5,000/5 =1,000
5,000/25=200
5,000/125 =40
5,000/625 =8
5,000/3,125 =1, when there a fraction involved, just ignore the fraction and take the integer part.
Total =1,000+200+40+8+1 =1,249 trailing zeros in 5,000!.
n=5*(10!)
no of zeros does n end with?
Legendre's Theorem - The Prime Factorization of Factorials
In mathematics,
Legendre's formula gives an expression for the exponent of the largest power of a prime p that divides the factorial
\({\displaystyle n!}\)
1. The exponent of 2x
We calculate 10 in base 2:
\(\begin{array}{rcll} 10_{10} &=& 1010_2 \\ \end{array}\)
The sum of the digits in base 2 is \(\begin{array}{rcll} 1+0+1+0 = 2 \end{array}\)
The exponent is: \(\begin{array}{|rcll|} \hline x &=&\frac{10-(\text{sum of the standard base-}\mathbf{2}\text{ digits of 10})}{\mathbf{2}-1} \\ x &=&\frac{10-2}{2} \\ x &=&4\\ \hline \end{array}\)
2. The exponent of 5x
We calculate 10 in base 5:
\(\begin{array}{rcll} 10_{10} &=& 20_5 \\ \end{array}\)
The sum of the digits in base 5 is \(\begin{array}{rcll} 2+0 = 2 \end{array}\)
The exponent is: \(\begin{array}{|rcll|} \hline x &=&\frac{10-(\text{sum of the standard base-}\mathbf{5}\text{ digits of 10})}{\mathbf{5}-1} \\ x &=&\frac{10-2}{4} \\ x &=&2\\ \hline \end{array}\)
\(\begin{array}{|rcll|} \hline 10! &=& 2^4\cdot 5^2\ldots \\ n=5\cdot 10! &=& 2^4\cdot 5^3\ldots \\ \hline \end{array}\)
Number of zeros does n end with ?:
\(\begin{array}{|rcll|} \hline && 2^4\cdot 5^3 \\ &=& 2^3\cdot5^3\cdot 2 \\ &=& (2\cdot 5)^3 \cdot 2 \\ &=& 2\cdot 10^\mathbf{\color{red}3} \\ \hline \end{array}\)
n ends with 3 zeros.