Select Page

Counting concept is one of the most important and frequently tested topics in quantitative aptitude for competitive exams. It is asked in almost every major exam including CAT, MBA entrance exams, SSC CGL, SSC CHSL, Bank PO, Bank Clerk, Railway RRB and CSAT. A strong understanding of counting concept including highest power, trailing zeroes and non-zero digit formulas is essential for scoring well in these exams. In this post we cover everything from finding the highest power of a number in N factorial, number of trailing zeroes in a factorial, first non-zero digit in N factorial and first two non-zero digits in N factorial — all explained with clear formulas and solved examples.

                                                     Highest Power of a Number in N!

Introduction:-

There are two ways to represent a factorial number:-

a! or 5! ora5Popular form

N! = N × (N-1) × (N-2) × (N-3) × ……….. × 1

0!= 1
1!= 1
2!= 2
3!= 6
4!= 24
5!= 120
6!= 720

Highest power of a number in N!:-

method (1):-

Highest power of prime number p that divides n! exactly i.e. without leaving any remainder is given by:-

 

where [a] represents greatest integer less than or equal to a.

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

Solution:- 

 

= 33 + 11 + 3 + 1
= 48 Answer 

method (2):-

Quotient form → Successive division

333331003311133 + 11 + 3 + 1 = 48 Answer

(Q). Find the highest power of 6 in 150!
Solution:-
First, since 6 is a composite number so convert it into its prime factors.
6 = 2 × 3
now

22221815075379222421333315050165175 + 37 + 18 + 9 + 4 + 2 + 1= 14650 + 16 + 5 + 1= 72

So highest power of 2 in 150! = 146
& highest power of 3 in 150! = 72
∴ Highest power of 6 in 150! = minimum of above two values = 72 Answer

                                                  Number of Zeroes in the Factorial of a Number

Number of zeroes in the factorial of a number will be the highest power of 10 in the factorial. & 10 can be written as 2 × 5 in its prime factor form.
& we know that in any factorial power of 2 is always  greater than power of 5. Hence to find the number of trailing zeroes we only need to find the highest power of 5 in the factorial & that will be the number of trailing zeroes in the factorial of the number.

(Q). Find the highest power of 10 or number of trailing zeroes in 160!.
Solution:-
          10 = 2 × 5

5551603261

i.e. highest power of 5 in 160! is : 32 + 6 + 1 = 39
∴ Number of trailing zeroes in 160! is 39 Answer

(Q). Find the highest power of 1000 in 1000!
Solution:-
1000 = 10 × 10 × 10 = 2³ × 5³
now first we will find the highest power of 5 in 1000!

555100020040851

i.e. = 200 + 40 + 8 + 1 = 249
∴ highest power of 5 in 1000! is 249 & that of 5³ will be:-

\(\frac{{249}}{3}\)
= 81

∴ Highest power of 1000 in 1000! will be 81 Answer

 

                                                    First non-zero digit in N!

i.e. the first digit which is not zero after the trailing zeros from rightmost side in N!

firstly note down this:-

 

U[6 × 0] = 0U[6 × 2] = 2U[6 × 4] = 4U[6 × 6] = 6U[6 × 8] = 8Even numbers

where ‘U𝒹’ means unit digit i.e. if we multiply 6 to any even number, we get the same even number as the unit digit of the product.

  To find the last digit of 2ᴺ
First divide N by 4 & find the remainder.
if remainder is 0 then unit digit = 6
if remainder is 1 then unit digit = (2)¹ = 2
if remainder is 2 then unit digit = (2)² = 4
if remainder is 3 then unit digit= (2)³ = 8

To find the first non-zero digit first try to understand the concept from which we will derive a simple formula:-

⇨ Find the first non-zero digit in 42!

Since we know that in any factorial number power of 2 is always greater than power of 5 & we get a trailing zero in the factorial only when a 5 is multiplied by 2, (5×2=10) & 5 will be present in every successive dividend of 5 i.e.  ⇨ 5, 10, 15, 20, 25, 30, 35, ……… So first we will try to make group of Five-Five number from this factorial. ⇨

42!= (1×2×3×4×5) × (6×7×8×9×10) × (11×12×3×4×15) × (16×17×18×19×0) × ……. × (36×37×38×9×40) × (41×42)
⇨ Here total group are 9 & if we count (41×42) as extra group then total five-five element’s group are \(\frac{{40}}{5}\)
= 8

now we can extract all 5 & the same number of 2s from this & the unit digit of the remaining product will give us the First Non Zero Digit in N!. But this will be a very typical job to do this in spite of this being a small number & when the number will become very large it will be next to impossible task to do it manually. that’s why by & by we will derive to a formula. Now again these groups can be written as:-

42!=(10 × 12) × (10 × 3024) × (10 × 36036) × (10 × 186048) × ....... × (10 × 7896096) ×( 41 × 42)first groupsecond groupthird groupfourth group8 group

this can be again written as:-

42!=(10 × 12 × 1) × (10 × 1512 × 2) × (10 × 12012 × 3) × (10 × 46512 × 4) × ....... × (10 × 987012 × 8) ×( 41 × 42)first groupsecond groupthird groupfourth group8 group

Here multiplication of 10 will count to the trailing zeros in the factorial so we can ignore it to find the last non-zero digit.
now again we can notice that in every group the number can be written as (after ignoring 10)  ⇨ a number of which last digit is 2 × group number)

So to find first non-zero digit we can write as:-

first non-zero digit of 42! =

U(2×1) × U(2×2) × U(2×3) × U(2×4) ×.......× U(2×8) ×U(2!)U of (41×42)

which equals to
U𝒹(2⁸) × U𝒹(1×2×3×4×5×6×7×8) × U𝒹(2!)

=U𝒹(2⁸) × U𝒹(8!) × 240320ignore this zerotake this one= 6×2×2= 4what we can notice in this is that

we can write directly it by:-
divide 42 by 5 which gives quotient as 8 & remainder as 2.
then write direct as
first non-zero digit of 42!
=U𝒹(2⁸) × U𝒹(8!) × U𝒹(2!)

so we can generalize a simple formula:-

To find the first non-zero digit in N! divide N by 5 & let quotient be Q & remainder be R then First Non-Zero Digit of N!=

U(2) × U(Q!) × U(R!)

now take an example:-

(Q). Find the first non-zero digit in 89!.
Solution:-
 

17 Quotient4 Remainder

∴ FNZD(89!) = U𝒹(2¹⁷) × U𝒹(17!) × U𝒹(4!)

= 2 × U(17!) × 4again apply the same recursive formulaFor this 3 Q2 R

2 × U𝒹(2³) × U𝒹(3!) × U𝒹(2!) × 4
= 2 × 8 × 6 × 2 × 4
=8 Answer

So if number is large then we need to apply this formula multiple times. this is the one way. But if you do not want to apply this formula multiple times then use the concept of successive division. which will be our second approach:-

Let highest power of 5 in N! is H & R1, R2, R3,……… are the remainders of successive division of N by 5 then

FNZD(N!)= U(2) × U(R!) × U(R!) × U(R!) ×........

we are to do successive division process untill quotient becomes zero.

Example:- Find the FNZD of 197!.

Solution:- FNZD(197!) = ?

5555Remainder197397102214RRRR

Highest power of 5 in 197! i.e. H = 39 + 7 + 1 + 0 = 47
& R₁ = 2
    R₂ = 4
    R₃ = 2
    R₄ = 1

∴ FNZD(197!) =  U𝒹(2⁴⁷) ×  U𝒹(2!) ×  U𝒹(4!) ×  U𝒹(2!) ×  U𝒹(1!)
= 8 × 2 × 4 × 2 × 1
= 8 Answer

First approach:- 
FNZD(197!) = U𝒹(2³⁹) × U𝒹(39!) × U𝒹(2!)
                       = 8 × U𝒹(39!) × 2
                       = 6 × U𝒹(39!)

Since all the factorial except of 1 (i.e. 1!) are always even numbers & so 39! will also be an even number i.e. U𝒹(39!) will also be an even number & we told earlier that 6 multiplied by even number gives the same even number so we can ignore 6 in FNZD counting when it is to be multiplied by an even number.

= U𝒹(39!)
= U𝒹(2⁷) × U𝒹(7!) × U𝒹(4!)

= 8 × U(7!) × 4

= 2 × U𝒹(7!)
= 2 × U𝒹(2¹) × U𝒹(1!) × U𝒹(2!)
= 2 × 2 × 1 × 2
= 8 Answer 

                                                  First Two non-zero digit in N!

First understand some basic concept:-
To find last two digit of lets

3 6 × 5 1+×66 × 5 = 3 03 × 1 = 3+3Unit digit35 9 × 7 89×8 = 7 2 2Unit digit9×7 = 6 35×8 = 4 0Take 7 as carry7++1 004 8 3 × 5 9 8ignoreignorewe take only rightmost two digits for multiplication42741 337 8 5 6 2 × 1 5 9 8 7 ignoreignore412699we take only rightmost two digits for multiplicationnow the other concept2 = 1 0 4 8 5 7 6

& (76)ⁿ = last two digits always 76
& 3⁴ = 81
& (81)ⁿ = always 1 at unit place & last digit of (8 × last digit of n) will be at tens place.

For Example:- 

(81) 6 17 × 8 = 5 6(81)2 18 × 9 = 7 2(81)2 18 × 9 = 7 2(81)6 18 × 2 = 1 6

Now come to the point to find the first two non-zero digits of a factorial N!

find the highest power of 5 in N!. let it be H. then understand it with an example:-
182!

Remainder5555182367102211QQQQ= U[182 × 181] = 42= U[36] = 36= U[7 × 6] = 42= U[1] = 1

& Highest power of 5 in 182! is: H=36 + 7 + 1 + 0 = 44
so U(182!) = Uₜ(12ᴴ) × Uₜ(Q₁ × Q₂ × Q₃ × Q₄)

= 12 × 42 × 36 × 42 × 1

= 12⁴⁴ × 12 × 42
= 12⁴⁴ × 04
= (2²×3)⁴⁴ × 4
= 2⁸⁸ × (81)¹¹ × 4
= (2²⁰)⁴ × 2⁸ × 81 × 4
= 76 × 56 × 24
= 56 × 24
= 44 Answer

Take another example:-
Uₜ(1038!) = ?

Remainder5555103820741813123QQQQ= U[1038 × 1037 × 1036] = 16= U[207 × 206] = 42= U[41] = 41= U[8 × 7 × 6] = 36501Q = U[1] = 1

H = 207+41+8+1+0
    = 257
now Uₜ(1038!) = Uₜ(12ᴴ) × Uₜ(Q₁ × Q₂ × Q₃ × Q₄ × Q₅)

= U(12) × U(16×42×41×36)= (2×3) × 72 × 76= 2 × 3 × 72= (2) × 2 × (3) × 3 × 72= (76) × 84 × (81) × 16= 76 × 84 × 21 × 16= 84 × 36= 24 Answer

❓ Frequently Asked Questions on Counting Concept

Q1. How to find the highest power of a number in N factorial?

The highest power of a prime number p that divides N! exactly is found by adding [N/p] + [N/p²] + [N/p³] + … where [x] represents the greatest integer function. For example the highest power of 3 in 100! = [100/3] + [100/9] + [100/27] + [100/81] = 33 + 11 + 3 + 1 = 48. If the number is composite then first convert it into its prime factors and find the highest power of each prime, then the answer is the minimum value among them divided by the respective power in the composite number. This concept is a direct application of Legendre’s formula and is frequently asked in CAT, SSC CGL and Bank PO exams.

Q2. How to find the number of trailing zeroes in a factorial?

The number of trailing zeroes in N! is the highest power of 10 in N!. Since 10 = 2 × 5 and power of 2 is always greater than power of 5 in any factorial, the number of trailing zeroes equals the highest power of 5 in N!. For example the number of trailing zeroes in 160! = [160/5] + [160/25] + [160/125] = 32 + 6 + 1 = 39. This is one of the most frequently asked questions in SSC CGL and CAT exams.

Q3. How to find the first non-zero digit in N factorial?

To find the first non-zero digit in N! divide N by 5 to get quotient Q and remainder R. The first non-zero digit = unit digit of (2^Q) × unit digit of (Q!) × unit digit of (R!). This formula is applied recursively if Q itself is large. For example the first non-zero digit of 89! is found by dividing 89 by 5 to get Q=17, R=4 and then applying the formula recursively until the quotient becomes small, giving the final answer as 8.

Q4. What is the successive division method for finding first non-zero digit?

In the successive division method we keep dividing N by 5 repeatedly and note all the remainders R1, R2, R3 and so on until the quotient becomes zero. If H is the highest power of 5 in N! then the first non-zero digit = unit digit of (2^H) × unit digit of (R1!) × unit digit of (R2!) × unit digit of (R3!) and so on. For example for 197! the successive division gives remainders 2, 4, 2, 1 and H = 47, giving first non-zero digit = 8.

Q5. How to find the first two non-zero digits in N factorial?

To find the first two non-zero digits in N! we use the highest power of 5 in N! denoted by H and the successive quotients Q1, Q2, Q3 obtained from dividing N by 5 repeatedly. The formula uses the last two digits of 12^H multiplied by the last two digits of the product of all quotients, using the property that 76 raised to any power always ends in 76 and properties of 81 raised to powers. For example the first two non-zero digits of 182! is found to be 44 using this method.

Q6. Why is the highest power of 5 used instead of 2 while finding trailing zeroes?

In any factorial the count of even numbers contributing a factor of 2 is always more than the count of multiples of 5 contributing a factor of 5. Since a trailing zero is formed only when a 2 and a 5 pair together (2×5=10), the limiting factor is always the smaller count which is the power of 5. Hence we only calculate the highest power of 5 in N! to find the number of trailing zeroes, since power of 2 will always be sufficient to pair with every 5 available.

Q7. Where can I practice questions on highest power, trailing zeroes and non-zero digits?

After understanding the concept you can practice on our Counting Concept Exercise page which contains a large number of solved practice questions. You can also check our Unit Digit Concept and Remainder Theorem Concept pages for related topics.