# Number of zeros at the end of a factorial

Number of zeros at the end of a
Problem Type: Number of zeros at the end of p!
To solve such type of problems we see only pair of 2 x5 in p! .
Because if a number is divisible by 10 then it will have 0 in the end and 10= 2×5 so finding number of zeros is equivalent to finding maximum power of 10 in p! which is same as counting number of pairs of 2 and 5.
Lets take an example for this

Example
Find the number of zeros at the end of 45!
Solution:
Zero mainly comes from the combination of (5x 2) or by the presence of 10, and the number of zeros depends upon the number of times 10 is involved.So we check power of 2 and 5 first
Maximum power of 2 in 45!

$\displaystyle \begin{array}{l}\left[ \frac{45}{2} \right]+\left[ \frac{45}{{{2}^{2}}} \right]+\left[ \frac{45}{{{2}^{3}}} \right]+\left[ \frac{45}{{{2}^{4}}} \right]+\left[ \frac{45}{{{2}^{5}}} \right]+…..\\=\text{ }22\text{ }+\text{ }11\text{ }+\text{ }5\text{ }+\text{ }2\text{ }+1=\text{ }41\\Maximum\text{ }power\text{ }of\text{ }5\text{ }in\text{ }45!\\\left[ \frac{45}{5} \right]+\left[ \frac{45}{{{5}^{2}}} \right]+\left[ \frac{45}{{{5}^{3}}} \right]+…..\\\begin{array}{*{35}{l}} =\text{ }9+\text{ }1 \\ =\text{ }10 \\ \end{array}\\\end{array}$

So in 45! Number of 2’s are 41
And the number of 5’s is 10
So maximum pair of 2 and 5 that can be made are 10 so the number of zeros at the end of the 45! is 10.

Example
Find the number of zeros in 500!
Solution: Zero mainly comes from the combination of (5x 2) or by the presence of 10, and the number of zeros depends upon the number of times 10 is involved.So we check power of 2 and 5 first
Maximum power of 2 in 500!

$\displaystyle \begin{array}{l}\left[ \frac{500}{2} \right]+\left[ \frac{500}{{{2}^{2}}} \right]+\left[ \frac{500}{{{2}^{3}}} \right]+\left[ \frac{500}{{{2}^{4}}} \right]+\left[ \frac{500}{{{2}^{5}}} \right]+\left[ \frac{500}{{{2}^{6}}} \right]+\left[ \frac{500}{{{2}^{7}}} \right]+\left[ \frac{500}{{{2}^{8}}} \right]…\\\begin{array}{*{35}{l}} =\text{ }250\text{ }+\text{ }125\text{ }+\text{ }62\text{ }+\text{ }31\text{ }+15\text{ }+7\text{ }+\text{ }3\text{ }+\text{ }1 \\ =\text{ }494 \\ \end{array}\\Maximum\text{ }power\text{ }of~5\text{ }in\text{ }500!\\\left[ \frac{500}{5} \right]+\left[ \frac{500}{{{5}^{2}}} \right]+\left[ \frac{500}{{{5}^{3}}} \right]+\left[ \frac{500}{{{5}^{4}}} \right]+…..\\\begin{array}{*{35}{l}} =\text{ }100\text{ }+\text{ }20\text{ }+\text{ }4 \\ =\text{ }124 \\ \end{array}\end{array}$
Number of 5’s in 500! are  124
And the numbers of 2’s is  494
So the maximum possible pairs of 2 and 5 that can be made are 4 so the number of zeros in 500! are 124 .So the number of zeros in the end of the 500! are 124.

Example
What will be the number of zeros in (24!)3! ?
Now first calculate the number of zeros in 24!
Maximum power of 2 in 24!
$\displaystyle \begin{array}{l}\left[ \frac{24}{2} \right]+\left[ \frac{24}{{{2}^{2}}} \right]+\left[ \frac{24}{{{2}^{3}}} \right]+\left[ \frac{24}{{{2}^{4}}} \right]+…..\\\begin{array}{*{35}{l}} =\text{ }12\text{ }+\text{ }6\text{ }+\text{ }3\text{ }+\text{ }1 \\ =\text{ }22 \\ \end{array}\\Maximum\text{ }power\text{ }of\text{ }5\text{ }in\text{ }24!\\\left[ \frac{24}{5} \right]+\left[ \frac{24}{{{5}^{2}}} \right]+…..\\\begin{array}{*{35}{l}} =\text{ }4\text{ }+\text{ }0 \\ =\text{ }4 \\ \end{array}\end{array}$
Number of 5’s in 24! is 4
And the numbers of 2’s are more than 4
So the maximum possible pairs of 2 and 5 that can be made are 4 so the number of zeros in 24! are 4
Now 24! also have power of 3! i.e. 6 . So the whole expression would have 4 x 6 = 24 zeros in the end.