1. ## Wilson's Theorem

So I've been working on this problem for too long now and I need some advice as to how to proceed. I've tried using induction and I've also tried plugging in concrete values to try and discern a pattern to no avail. I DO know that Wilson's Theorem applies.

Wilson's Theorem
If p is a prime, then (p-1)! $\equiv$ -1 (mod p)

Problem
Show that if p is an odd prime and a and b are non negative integers with a+b=p-1, then a!b! + (-1)^a $\equiv$ 0 (mod p)

2. ## Re: Wilson's Theorem

Note that: $a! = 1\cdot ... \cdot a \equiv_p \left( (-1) \cdot (p-1) \right)\cdot .. \cdot \left( (-1) \cdot (p-a) \right)$ and that $p-a = b + 1$

3. ## Re: Wilson's Theorem

Originally Posted by PaulRS
Note that: $a! = 1\cdot ... \cdot a \equiv_p \left( (-1) \cdot (p-1) \right)\cdot .. \cdot \left( (-1) \cdot (p-a) \right)$ and that $p-a = b + 1$

I tried factoring out the (-1) getting a! congruent to (-1)^a[(p-1)...(p-a)]. Then I tried to multiply by b! considering that p-a=b+1, but I'm getting nowhere. Man I feel stupid!

4. ## Re: Wilson's Theorem

Originally Posted by PaulRS
Note that: $a! = 1\cdot ... \cdot a \equiv_p \left( (-1) \cdot (p-1) \right)\cdot .. \cdot \left( (-1) \cdot (p-a) \right)$ and that $p-a = b + 1$
I'm going to try to complete this.

$a!\equiv (-1)^a(p-1)\cdots(p-a)\pmod{p}$

$a!b!\equiv (-1)^a(p-1)\cdots(p-a)b!\pmod{p}$

$\equiv (-1)^a(p-1)!\pmod{p}$ (Note that $p-a = b + 1$.)

$\equiv -(-1)^a\pmod{p}$ (Using Wilson's theorem)

$a!b!+(-1)^a\equiv 0\pmod{p}$

5. ## Re: Wilson's Theorem

Originally Posted by alexmahone

$(-1)^a(p-1)\cdots(p-a)b!\pmod{p}$

$\equiv (-1)^a(p-1)!\pmod{p}$ (Note that $p-a = b + 1$.)
I don't understand how you got this congruence.

6. ## Re: Wilson's Theorem

Originally Posted by UNLVRich
I don't understand how you got this congruence.
$(p-1)\cdots(p-a)b!=(p-1)\cdots(p-a)(p-a-1)!=(p-1)!$

Thank you!