1. ## Wilson's Theorem

Use Wilson;s Theorem to find the least nonnegative residue modulo m of integer n

n=30! m=31

2. Hello,
Originally Posted by bigb
Use Wilson;s Theorem to find the least nonnegative residue modulo m of integer n

n=30! m=31
Wilson's theorem : $(p-1)! \equiv -1 (\bmod p)$ (where p is a prime integer)
Here, p=31 and is prime.

So $30! \equiv -1 (\bmod 31)$

But $-1 \equiv 30 (\bmod 31)$

So answer is 30, since you want the least nonnegative residue.