The factorial of a non-negative integer is the product of all positive integers up to and including the number. The factorial of a given number is usually denoted as . is equal to following the convention for an empty product.
Formally the factorial of can be defined as follows
This can also be written recursively as a product of previous factorials