I would like to use Wilson's Theorem to compute
$(p - 4)! \mod p$
I've gotten as far as
$(p - 4)! \cdot (p-3) \cdot (p-2) \cdot (p-1) \equiv (p - 1) \pmod p$
However I can't figure out how to isolate
$(p - 4)! \mod p$
I would like to use Wilson's Theorem to compute
$(p - 4)! \mod p$
I've gotten as far as
$(p - 4)! \cdot (p-3) \cdot (p-2) \cdot (p-1) \equiv (p - 1) \pmod p$
However I can't figure out how to isolate
$(p - 4)! \mod p$
By Wilson reflection $\rm\ mod\ p\!:\: -1 \equiv (p\!-\!1)! = \overbrace{(p\!-\!1)(p\!-\!2)(p\!-\!3)(p\!-\!4)!}^{\textstyle\!\!\! \equiv (-1)\,\ (-2)\,\ (-3)\ (p\!-\!4)!}\equiv -6(p\!-\!4)!$
But for $\rm\:p \ne 2,3,\: \ \ 2\cdot 3 = 6\:$ will be invertible mod $\rm\:p,\:$ so $\rm\:(p-4)! \equiv 1/6\pmod{\! p}$
Furthermore, $\, $ notice $\rm\ \ p = 6\:k\pm 1\ \Rightarrow\ \bbox[5px,border:1px solid #c00]{(p\!-\!4)!\,\equiv\, 1/6\, \equiv \mp k},\, $
Similarly $\rm\,-1 \equiv (p\!-\!1)! \equiv 2(p\!-\!3)! \:\!\Rightarrow \bbox[5px,border:1px solid #c00]{\rm(p\!-\!3)! \equiv -1/2 \equiv (p\!-\!1)/2},\,$ for odd $\rm\,p$.
$\ \ \ \ $ and $\rm \, \ \ \ {-}1 \equiv (p\!-\!1)!\equiv -(p\!-\!2)! \Rightarrow \bbox[5px,border:1px solid #c00]{\rm(p\!-\!2)! \equiv \:\!1}$
We can compose the above formulas e.g. $\,\rm \bbox[5px,border:1px solid #c00]{(p\!-\!5)!\equiv \pm 9k^3}_{\phantom{|}}\,$ e.g. $\!\bmod 61\!:\ 56!\equiv 9(10)^3\!\equiv 33,\,$ since: $\rm\ (p\!-\!5)!\:\!\equiv -\frac{1}{24}\equiv -\frac{1}6 (\frac{1}2)^2\equiv \pm k\:\!(\mp 3k)^2\equiv\:\! \pm 9k^3$.
Note $\:$ The signed-equation denotes two equations: the top sign case, and bottom sign case. $$\begin{eqnarray}\rm\:p = 6\:\!k{\color{#c00}{+1}}\: &\Rightarrow& \rm\:(p-4)!\equiv 1/6\equiv (1+{\color{#c00}{(-1)}} p)/6&\rm\quad top\ signs \\ \rm\:p = 6\:\!k{\color{#c00}{-1}}\: &\Rightarrow &\rm\:(p-4)!\equiv 1/6\equiv (1+{\color{#c00}{(+1)}} p)/6&\rm\quad bottom\ signs \end{eqnarray}$$ Indeed, we seek $\rm\:x\:$ so $\rm\:6\:|\:1+x\:\!p,\:$ or $\rm\:mod\ 6\!:\: -1\equiv x\:\!p \equiv x\!\:s,\:$ where $\rm\:\color{#c00}s = (p\ mod\ 6),\,$ by inverse reciprocity. So $\rm\:x \equiv -1/s.\:$ Here $\rm\:s\equiv \pm1\:\Rightarrow\:s^2 = 1\:\Rightarrow\: -1/s = -s/s^2 = -s,\:$ so $$\rm\:p = 6\:\!k+{\color{#c00}{s}}\: \Rightarrow\: (p-4)!\equiv 1/6\equiv (1+{\color{#c00}{(-s)}}\:\! p)/6\quad abstract\ sign$$ Hence the equation that I wrote above involving the signs $\pm$ and $\mp,$ denotes two equations, the case $\rm\:s = 1\:$ of above (choose all the top signs) and case $\rm\:s = -1\:$ (choose all the bottom signs). Indeed, if we substitute $\rm\: s = \pm 1\:$ then $\rm -s = \mp 1,\:$ so we obtain said equation with signs.
Such expressions can be given a rigorous algebraic interpretation by working in certain quotient rings,$\:\!$ i.e. modulo $\rm\:s^2 = 1.\:$ Namely $\rm\:R[s]/(s^2-1) \cong R[s]/(s-1) + R[s]/(s+1)\cong R^2.\:$ Hence arithmetic in $\rm\:R\:$ with adjoined sign $\rm\:s\:$ is isomorphic to arithmetic of pairs of elements of $\rm\:R,\:$ where the first component denotes the universe where $\rm\:s = 1\:$ and the second where $\rm\:s = -1.\:$
Beware, however, that sometimes such signed expressions denote the set of equations resulting from all possible combinations of signs. In this case one adjoins multiple sign indeterminates $\rm\:s_i\:$ such that $\rm\:s_i^2 = 1.\:$ One often needs to infer from the context which denotation is intended.
You can use the facts that $p-k \equiv -k \mod p$. Then you have to decide whether the product is invertible.
In general, $$(p-k)!\equiv\frac{(-1)^{k-2}}{(k-1)!}\pmod p$$ Examples: