# Find the remainder when 15! is divided by 31

Find the remainder when 15! is divided by 31. I know I have to apply wilsons theorem but i am a little confused how..

-
How does 30! relate to 15! mod 31? –  M.B. May 3 '14 at 0:27

By Wilson, we know that $30!\equiv-1$ (mod 31). Now lets look at the extra factors that are multiplied to turn $15!$ into $30!$.
$16\equiv -15$ (mod 31), $17\equiv -14$ (mod 31), $\ldots, 30\equiv -1$ (mod 31)
Thus $\frac{30!}{15!}\equiv (-1)^{30-15}\cdot 15!=-15!$ (mod 31)
Thus we get $$-1\equiv 30!=15!\frac{30!}{15!}\equiv -1\cdot (15!)^2\Rightarrow 15!=\pm1\text{ (mod 31)}$$