Online Reference

 

 

ALGEBRA
RAPID TABLES

 

 

    Home > Math > Algebra > Factorial

Factorial (n!)

The factorial of n is denoted by n! and calculated by the product of integer numbers from 1 to n.

For n>0,

n! = 1×2×3×4×...×n

For n=0,

0! = 1

Factorial definition formula

n!=\begin{Bmatrix}1 & ,n=0 \\ \prod_{k=1}^{n}k & ,n>0\end{matrix}

Examples:

1! = 1

2! = 1×2 = 2

3! = 1×2×3 = 6

4! = 1×2×3×4 = 24

5! = 1×2×3×4×5 = 120

Recursive factorial formula

n! = n×(n-1)!

Example:

5! = 5×(5-1)! = 5×4! = 5×24 = 120

Striling's approximation

n!\approx \sqrt{2\pi n}\cdot n^n\cdot e^{-n}

Example:

5! ≈ √2π5·55·e-5 = 118.019

Factorial table

Number

n

Factorial

n!

01
11
22
36
424
5120
6720
75040
840320
9362880
103628800
113.991680x107
124.790016x108
136.227021x109
148.717829x1010
151.307674x1012
162.092279x1013
173.556874x1014
186.402374x1015
191.216451x1017
202.432902x1018

C program for factorial calculation

double factorial(unsigned int n)

{

    double fact=1.0;

   

    if( n > 1 )

        for(unsigned int k=2; k<=n; k++)

            fact = fact*k;

 

    return f;

}

 


See also

© 2006-2008 RapidTables.com