
factorial function
The factorial of a number, written as n!, is the product of all positive integers from 1 up to that number. For example, 4! equals 1 × 2 × 3 × 4, which is 24. Factorials are used in mathematics and statistics to count combinations and arrangements, helping to understand how many different ways items can be ordered or selected. The factorial function grows very quickly as the number increases. By definition, 0! is 1, serving as a foundation for many formulas involving factorials.