In mathematics, the product of all the integers from 1 up to some non-negative integer n that have the same parity as n is called the double factorial or semifactorial of n and is denoted by n!!. That is,
where A consequence of this definition is that (as an empty product)
For example, 9!! = 1 × 3 × 5 × 7 × 9 = 945.
For even n the double factorial is
For odd n it is
The sequence of double factorials for even n = 0, 2, 4, 6, 8, ... starts as
1, 2, 8, 48, 384, 3840, 46080, 645120, .... (sequence A000165 in OEIS)
The sequence of double factorials for odd n = 1, 3, 5, 7, ... starts as
1, 3, 15...