I'm not getting Wilson's theorem to work?

60 Views Asked by At

Wilson's theorem states that:

p is a prime if and only if (p - 1)! $\cong$ -1 (mod p)

Obviously 5 is a prime so this should be true:

(5 - 1)! $\cong$ -1 (mod 5)

But when I tried to test it it doesn't work:

$(5 - 1)! = 4*3*2*1 = 24$

I get the results:

24 % 5 = 4

$24 \cong 4$(mod 5)

Edit: I'm so stupid

2

There are 2 best solutions below

0
On BEST ANSWER

Do not worry, you are correct.

Note that $$24 \cong 4(mod5) \cong -1(mod5)$$

Remember, $$24-(-1)=24+1 =25=5k$$

0
On

Note that $$4 \bmod 5 \equiv -1 \bmod 5.$$