I need to find : $ 2000! \mod 2003$
Please justify each step instead of a simple numerical answer.
HINT: 2003 is a prime number.
I need to find : $ 2000! \mod 2003$
Please justify each step instead of a simple numerical answer.
HINT: 2003 is a prime number.
As $2003$ is prime, using Wilson's theorem, $$2002!\equiv-1\pmod{2003}$$
Now, $\displaystyle2002!=2002\cdot2001\cdot2000!\equiv(-1)(-2)2000!\pmod{2003}\equiv2\cdot2000!$
$\displaystyle\implies2000!\equiv-2^{-1}\pmod{2003}\equiv-1002\equiv1001$ as $\displaystyle1002\cdot2=2004\equiv1\pmod{2003}$
More generally for prime $p>3,$
$\displaystyle(p-3)!=\frac{(p-1)!}{(p-1)(p-2)}\equiv\frac{-1}{(-1)(-2)}\equiv-2^{-1}\equiv-\frac{p+1}2\pmod p\equiv\frac{p-1}2$