What is factorial? How to calculate factorial of a number?
Definition of factorial
The factorial is the product of an integer and all the integers below it; e.g. factorial four ( 4! ) is equal to 24 (4 x 3 x 2 x 1). The factorial value of 0 is by definition equal to 1. For negative integers, factorials are not defined. The factorial can be seen as the result of multiplying a sequence of descending natural numbers (such as 3 x 2 x 1). The factorial symbol is the exclamation mark (!).
The factorial formula
If n is an natural number greater than or equal to 1, then n! = n x (n - 1) x (n - 2) x (n - 3) ... 3 x 2 x 1
If p = 0, then p! = 1 by convention.
Example: 6! = 6 x 5 x 4 x 3 x 2 x 1 = 720
Table of Factorials
n | n! |
---|---|
1 | 1 |
2 | 2 |
3 | 6 |
4 | 24 |
5 | 120 |
6 | 720 |
7 | 5040 |
8 | 40320 |
9 | 362880 |
10 | 3628800 |
11 | 39916800 |
12 | 479001600 |
13 | 6227020800 |
14 | 87178291200 |
15 | 1307674368000 |
16 | 20922789888000 |
17 | 355687428096000 |
18 | 6402373705728000 |
19 | 121645100408832000 |
20 | 2432902008176640000 |
21 | 51090942171709440000 |
22 | 1124000727777607680000 |
23 | 25852016738884976640000 |
24 | 620448401733239439360000 |
25 | 15511210043330985984000000 |
26 | 403291461126605635584000000 |
27 | 10888869450418352160768000000 |
28 | 304888344611713860501504000000 |
29 | 8841761993739701954543616000000 |
30 | 265252859812191058636308480000000 |