Factorial

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



Trick 1: Rightmost non-zero digit of n! or R(n!)


R(n!) = Last Digit of [ 2a x R(a!) x R(b!) ]

where n = 5a + b


e.g.
What is the rightmost non-zero digit of 37! ?

 R (37!) = Last Digit of [ 27 x R (7!) x R (2!) ]

 R (37!) = Last Digit of [ 8 x 4 x 2 ] = 4




Trick 2: Power of a prime p in a factorial (n!)


The biggest power of a prime p that divides n! (or in other words, the power of prime p in n!) is given by the sum of quotients obtained by successive division of n by p.


e.g
What is the highest power of 7 that divides 1342!

[1342 / 7] = 191

[191 / 7] = 27

[27 / 7] = 3

Power of 7 = 191 + 27 + 3 = 221



Trick 3: Number of ending zeroes in a factorial (n!)

Number of zeroes is given by the sum of the quotients obtained by successive division of n by 5.



e.g.
What is the number of ending zeroes in 134! ?

[134/5] = 26

[26/5] = 5

[5/5] = 1

Number of ending zeroes = 26 + 5 + 1 = 32

3 comments:

  1. could not understand trick 1..can u please elaborate it a bit more

    ReplyDelete
    Replies
    1. It's a well known formula.... you just need to express any number in form of 5a+b... like 22=5*4+2... kindly note that 25 is 5*4+5, here a=5 and b=5 ..

      Delete
    2. Jha, i think your doubt has been cleared by Mr. anand.
      Still have any problem , comment again . :-)

      Delete