Bodhee Prep-CAT Online Preparation

Number of trailing zeroes and exponents of prime number in factorial

factorial and trailing zeroes

Finding the number of trailing zeroes in 100! (read factorial 100) has become the favorite question in quant among aspirants who prepare for CAT Exam.  In this section, we will be discussing the approaches to solve similar sorts of questions.

Exponent of any prime number p in n! (factorial n)

The exponent of any prime number p in n! = \(\left[ {\frac{{\rm{n}}}{{{{\rm{p}}^1}}}} \right] + \left[ {\frac{{\rm{n}}}{{{{\rm{p}}^2}}}} \right] + \left[ {\frac{{\rm{n}}}{{{{\rm{p}}^3}}}} \right] + ..\), where, [ ] is the greatest integer function.

Here is the video explanation of the above concept

Example 1: Find the highest power of 3 in 100!


Highest power of 3 in 100! = \(\left[ {\frac{{100}}{{{3^1}}}} \right]\) + \(\left[ {\frac{{100}}{{{3^2}}}} \right]\) + \(\left[ {\frac{{100}}{{{3^3}}}} \right]\) + \(\left[ {\frac{{100}}{{{3^4}}}} \right]\) = 33 + 11 + 3 + 1 = 48

Point to note:

The above solution implies that when 100! is prime factorized, then the prime number 3 will have exponent or power equal to 48.

Similarly, we can find the power of 2 in 100! or any prime number less than 100.  By calculation, an obvious thing to observe is that power of 3 will always be greater than power of 5 but less than power of 2. We will use this observation in the next example.

Example 2: Find the highest power of 21 in 100!


As 21 = 3 \( \times \) 7

By formula, exponent of 3 and 7 in 100! is 48 and 16 respectively. Therefore, number of pairs of 3 and 7 (i.e. 3\( \times \)7) will be 16 only.  So, the highest power of 21 in 100! is 16

Wrong Approach:

Solving the above problem by using the formula directly like \(\left[ {\frac{{100}}{{{{21}^1}}}} \right]\) + \(\left[ {\frac{{100}}{{{{21}^2}}}} \right]\) +.. is wrong as 21 is NOT a prime, the formula is applicable only for prime numbers.

Example 3: Find the highest power of 12 in 100! (read factorial 100).


\(12 = {2^2} \times 3\)

By formula, exponent of 2 and 3 in 100! is 97 and 48 respectively.

To make one 12, we need two 2’s and one 3. The total number of 2’s is 97, and 3’s is 48. For every one 3 we need two 2’s, hence we will get 48 group of \(\left( {{2^2} \times 3} \right)\) by using 96 2’s and 48 3’s. So the answer to the question is 48.

Finding Number of Trailing Zeroes in Factorial:

Example 4: Find the number trailing of zeroes at the end of 100!


The number of trailing zeros is equal to the number of times 100! is successively divisible by 10.

Also, 10 = 2 \( \times \) 5. As power of 5 will always be less than power of 2, the number of 10’s in 100! is equal to  Exponent of 5 in 100!

i.e. \(\left[ {\frac{{100}}{5}} \right]\) + \(\left[ {\frac{{100}}{{{5^2}}}} \right]\) = 20 + 4 = 24. Hence there are 24 trailing zeros in 100!

Read Also:
How to prepare for CAT number system

FREE CAT Quant Practice Problems


Leave a Reply

Your email address will not be published. Required fields are marked *

CAT Online Courses

CAT 2023
Classroom Course

We are starting classroom course for CAT 2023 in Gurugram from the month of December.
Please fill the form to book your seat for FREE Demo Classes

CAT 2023 Classroom Course starts in Gurgaon