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:-
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
(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
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
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!
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:-
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:-
this can be again written as:-
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! =
which equals to
U𝒹(2⁸) × U𝒹(1×2×3×4×5×6×7×8) × U𝒹(2!)
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!=
now take an example:-
(Q). Find the first non-zero digit in 89!.
Solution:-
∴ FNZD(89!) = U𝒹(2¹⁷) × U𝒹(17!) × U𝒹(4!)
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
we are to do successive division process untill quotient becomes zero.
Example:- Find the FNZD of 197!.
Solution:- FNZD(197!) = ?
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!)
= 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
& (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:-
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!
& Highest power of 5 in 182! is: H=36 + 7 + 1 + 0 = 44
so Uₜ(182!) = Uₜ(12ᴴ) × Uₜ(Q₁ × Q₂ × Q₃ × Q₄)
= 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!) = ?
H = 207+41+8+1+0
= 257
now Uₜ(1038!) = Uₜ(12ᴴ) × Uₜ(Q₁ × Q₂ × Q₃ × Q₄ × Q₅)