Problem
NT-B2-M04-P011 The Factorial \((p-3)!\)
#11
★★★★☆ Level 4 of 5
Let \(p>3\) be prime. Find \((p-3)!\pmod p\).
Express \((p-1)!\) through \((p-3)!\).
We have \((p-1)!=(p-1)(p-2)(p-3)!\equiv(-1)(-2)(p-3)!\equiv2(p-3)!\pmod p\). By Wilson this equals \(-1\). Hence \(2(p-3)!\equiv-1\), so \((p-3)!\equiv -2^{-1}\pmod p\). Since \(2^{-1}\equiv (p+1)/2\), we get \((p-3)!\equiv (p-1)/2\pmod p\).
Requires care with the inverse of \(2\).