Wacky Factorials

We all know the definition of the factorial ! as n! = n(n-1)(n-2) \cdots 2*1 but there are even more definitions of factorials that mathematicians have invented.

Double Factorial

The double factorial looks like this n!!. It can be used to easily denote the product of the odd or even numbers less than or equal to n

    \[n!! =\left{\begin{matrix}n(n-2)(n-4) \cdots, \textrm{even n}\\n(n-2)(n-4)\cdots*1 , \textrm{odd n}\end{matrix}\right.\]

Subfactorial

The subfactorial has a really intuitive practical application. Imagine you have n tokens in defined positions in an array. You take all the tokens out and want to place every token back into the array so that none of the tokens end up in the position they were just in. This is called derangement.

For instance, {1, 2, 3},
You can arrange this set in the following ways: [1, 2, 3], [1, 3, 2], [2, 1, 3], [2, 3, 1], [3, 1, 2], [3, 2, 1].

Only two of these sets satisfies the above criteria, {2, 3, 1} and {3, 1, 2}

Therefore we say !3 = 2

Primorial

The Primorial is denoted n# and is the product of primes less than and equal to n.

n# = \prod_{P\leq n}^{}P

Primorials are used in the search for large prime numbers. Each primorial has more distinct prime factors than any number smaller than it.

Superfactorial (Sloane)

The more common definition of the Superfactorial. It is defined as such:

sf(n) = \prod_{k=1}^{n}k!

For example: sf(4) = 4!*3!*2!*1! = 288

You can look at it another way by expanding the factorials: sf(4) = 4*3^{2}*2^{3}*1^{4}

And so:

sf(n) = \prod_{k=1}^{n}k^{n-k+1}

Superfactorial (Pickover)

Another definition of the Superfactorial uses tetration.

    \[n\$ = _{}^{n!}\textrm{n!}\]

It grows insanely fast.

    \[4\$ = 24^{24\cdots^{24}}\]

Exponential Factorial

Annoyingly also denoted

    \[n\$\]

the exponential factorial is like a normal factorial but exponentiated instead of multiplied:

    \[4\$ = n^{n-1^{n-2}\cdots^{1}}\]

Hyperfactorial

Finally the hyperfactorial is defined like this:

H(n) = n^{n}(n-1)^{n-1} \cdots 2^{2} * 1^{1}

Or:
H(n)=\prod_{k=1}^{n}k^{k}

And hence is very similar to the Sloane definition of the superfactorial:

H(4) = 4^{4}*3^{3}*2^{2}*1^{1}