Arte SheetsLearn. Try. Understand.

Math & Engineering

Double Factorial n!! & Perfect-Matching Pairings (SEQUENCE & PRODUCT)

Calculate the double factorial n!! for odd and even non-negative integers using PRODUCT and SEQUENCE, and count distinct ways to pair 2k items into k unordered pairs.

Compute n!! = n * (n - 2) * (n - 4) ... without parity branching bugs

Unlike nested factorial FACT(FACT(n)), the double factorial (semifactorial) n!! multiplies every second integer down to 2 (for even n) or 1 (for odd n), with 0!! = 1 and 1!! = 1. For example, 7!! = 7 * 5 * 3 * 1 = 105, while 6!! = 6 * 4 * 2 = 48.

Generating INT((n + 1) / 2) terms starting at n with step -2 via SEQUENCE(INT((n + 1) / 2), 1, n, -2) inside PRODUCT handles both odd and even integers >= 2 in a single clean expression. In combinatorics and tournament design, (2k - 1)!! counts the exact number of ways to partition 2k players or teams into k simultaneous first-round matchups.

Integer nStepped FactorsDouble Factorial n!!Combinatorial Meaning
0 or 1Empty / {1}1Base convention 0!! = 1!! = 1
55 * 3 * 115Ways to pair 6 teams into 3 matches
66 * 4 * 2482^3 * 3! hyperoctahedral symmetry
77 * 5 * 3 * 1105Ways to pair 8 teams into 4 matches
88 * 6 * 4 * 23842^4 * 4! = 16 * 24

Universal Double Factorial n!! Formula

Validates that B2 is a non-negative integer and evaluates n!! across 0, 1, odd, and even inputs.

=IF(OR(B2 < 0, B2 <> INT(B2)), "Non-Negative Integer Required", IF(B2 <= 1, 1, PRODUCT(SEQUENCE(INT((B2 + 1) / 2), 1, B2, -2))))

Unordered Pairings of 2k Participants ((2k - 1)!!)

Counts distinct simultaneous pairings for an even participant count B3 (for example, 8 participants -> 7!! = 105).

=IF(OR(B3 < 2, MOD(B3, 2) <> 0), "Even Count >= 2 Required", PRODUCT(SEQUENCE(B3 / 2, 1, B3 - 1, -2)))

Try the example

Use the original values or change them to test your understanding.

Further reading