# Thread: Fermat's Little Theorem

1. ## Fermat's Little Theorem

Show that
(p-1)(p-2)...(p-r)==(-1)^r*r!(mod p)
for r=1, 2, ..., p-1.

I am totally lost on this one... Can you help me get started? Thanks.

Oops, this should have said Wilson's theorem in the title.

2. Remember this is all mod p.
So
1 = p+1 = 2*p+1, etc.

In particular,
p-1 = -1
p-2 = -2, etc.

Try replacing each term on the left with 'something equal to it mod p' on the right.

3. So something like
-1 * -2 * ... * -r == (-1)(-2)...(-r)(mod p)
== (-1)^r(1*28...*r)(mod p)
== (-1)^r * r! (mod p)
and we are done, right?

Thank you.