Saturday, 28 January 2017

Factorial



Factorial of n = n! = 1*2*3*…..(n-1)*n.

0! = 1. 1! = 1.



Say we have a factorial of f = f!. The number of times n is present in x! is :  

n = x^a * y^b * z^c*….

Then number of times n is present in f! is 

= min[1/a*{[f/x]+[f/(x^2)]+[f/(x^3)]+….}  +min[1/b*{[f/y]+[f/(y^2)]+[f/(y^3)]+….} +min[1/c*{[f/z]+[f/(z^2)]+[f/(z^3)]+….}+….


 

(m + n)! mod (m!*n!) = 0.

No comments:

Post a Comment