Wilson's Theorem/Corollary 2

Theorem
Let $n \in \Z, n > 0$ be a positive integer.

Let $p$ be a prime number.

Let $\displaystyle n = \sum_{j \mathop = 0}^k a_k p^k$ be the base $p$ presentation of $n$.

Let $p^\mu$ be the largest power of $p$ which divides $n!$, that is:
 * $p^\mu \divides n!$
 * $p^{\mu + 1} \nmid n!$

Then:
 * $\dfrac {n!} {p^\mu} \equiv \paren {-1}^\mu a_0! a_1! \dotsm a_k! \pmod p$