Sei sulla pagina 1di 2

How to Find Last Non-zero Digit of a Factorial

by P L Patodia
Steps:

1. Divide the factorial number by 5, take quotient and remainder. Again take quotient and
divide it by 5 and take quotient and remainder. Repeat this process till quotient becomes 0.
2. Add all the quotient. Divide this by 4. If it is divisible by 4, then it becomes 4, otherwise
take the remainder. Raise this to the power of 2 and take unit digit.
3. For each remainder, take unit digit of factorial. This number will be between 0 and 4. Ignore
0 and 1. For 2!, unit digit is 2. For 3!, unit digit is 6. For 4!, unit digit is 4.
4. Now multiply all these and you get last non-zero digit of a factorial.

Example 1: Compute Last Non-zero digit of 37!.

Number Quotient Remainder Factorial


37 7 2 2
5
7 1 2 2
5
1 0 1
5
Sum 8 As 8 is divisible by 4, 6
we take 2 4 . Unit
digit of 2 4 is 6

On multiplying 2x2x6, we get unit digit as 4. So, last non-zero digit of 37! is 4.

Example 2: Compute Last Non-zero digit of 159!.

Number Quotient Remainder Factorial


159 31 4 4
5
31 6 1
5
6 1 1
5
1 0 1
5
Sum 38 On dividing 38 by 4, 4
we get 2. Unit digit of
2 2 is 4

On multiplying 4x4, we get unit digit as 6. So, last non-zero digit of 159! is 6.

Copyright P L Patodia
Example 3: Compute Last Non-zero digit of 2345!.

Number Quotient Remainder Factorial


2345 469 0
5
469 93 4 4
5
93 18 3 6
5
18 3 3 6
5
3 0 3 6
5
Sum 583 On dividing 83 by 4, 8
we get 3. Unit digit of
23 is 8

On multiplying 4x6x6x6x8, we get unit digit as 2. So, last non-zero digit of 2345! is 2.

Example 4: Compute Last Non-zero digit of 12345!.

Number Quotient Remainder Factorial


12345 2469 0
5
2469 493 4 4
5
493 98 3 6
5
98 19 3 6
5
19 3 4 4
5
3 0 3 6
5
Sum 3082 On dividing 82 by 4, 4
we get 2. Unit digit of
2 2 is 4

On multiplying 4x6x6x4x6x4, we get unit digit as 4. So, last non-zero digit of 12345! is 4.

From the above examples, it is clear that if you know how to divide by 5, you can easily find last
non-zero digit of any factorial.

Copyright P L Patodia

Potrebbero piacerti anche