# Math Help - Stuck on a congruency problem

1. ## Stuck on a congruency problem

I'm using Wilson's Theorem to find the remainder of 24! when divided by 29. Here are my steps thus far:

24!*25*26*27*28 ≡ -1 mod 29

24!*(-4)*(-3)*(-2)*(-1) ≡ -1 mod 29

24!*24 ≡ -1 mod 29

How do I finish off the congruency to find the remainder?

2. Originally Posted by F350
I'm using Wilson's Theorem to find the remainder of 24! when divided by 29. Here are my steps thus far:

24!*25*26*27*28 ≡ -1 mod 29

24!*(-4)*(-3)*(-2)*(-1) ≡ -1 mod 29

24!*24 ≡ -1 mod 29

How do I finish off the congruency to find the remainder?
That's a good start. In fact, you're nearly there. Next step is to say that 24 ≡ –5 (mod 29), so 24!*5 ≡ 1 (mod 29). Finally 5*6 = 30 ≡ 1 (mod 29), so multiply both sides by 6 and you finish with 24! ≡ 6 (mod 29).