Double factorial

Math The double factorial (n!!) is an extension of the normal factorial function.

It is defined by the recurrence relation:

\[ n!! = \begin{cases} 1 & \text{if } n = 0, 1, \\ (n-2)!!\times n & \text{if } n > 1. \end{cases}\]

It can also be defined as:

(2n + 1)!! = 1 &times; 3 &times; ... &times; (2n - 1) &times; (2n + 1) if (2n + 1) is an odd number.

2n!! = 2 &times; 4 &times; ... &times; (2n - 2) &times; 2n if 2n is an even number.

The first few double factorials are: