# Given an odd prime $p$, prove that $2(p - 3)!$ is congruent to $-1 \bmod p$

My question is:

$p$ is odd and prime, prove that $2(p - 3)!$ is congruent to $-1 \bmod p.$

Here is what I have so far:

$(p - 1)! = (p - 1)(p - 2)(p - 3)!$

$(p - 1)(p - 2)(p - 3)! \equiv -1 \bmod p$

I know I need to get rid of $p - 1$ and $p - 2$ but I do not know how to find their inverses.

Any help is appreciated. Thank you!

So you know that $(p - 1)! \equiv -1 \pmod{p}$ -- this is Wilson's theorem. Expanding that out,

$$(p - 1) \times (p - 2) \times (p - 3)! \equiv -1 \pmod{p}.$$

But since you're working mod $p$, you can replace $p - 1$ with $-1$ in this product. since they are congruent mod $p$. Similarly you can replace $p - 2$ with $-2$.

Edited to add: Why can we replace $p - 1$ with $-1$? This is one of the laws of modular arithmetic. This appears to be a homework problem, so I'm assuming you have a textbook that at least states these rules (perhaps without proof). The general rule here can be expressed as:

For integers $a, b, c$ and positive integer $n$, if $a \equiv b {\pmod n}$, then $ac \equiv bc {\pmod n}$.

Why is this true, in general? If $a \equiv b {\pmod n}$, then by definition $b - a$ is a multiple of $n$ - call it $kn$ where $k$ is some integer. But then $bc - ac = c(b - a)$ is a multiple of $n$, namely $ckn$. So $ac \equiv bc {\pmod n}$ by the definition of congruence.

So now let's go back to specific case you're asking about. Let $a = p - 1$, $b = -1$, $c = (p - 2) \times (p - 3)!$, and $n = p$. It's obvious that $(p - 1) \equiv -1 {\pmod n}$ and so you get

$$(p - 1) \times (p - 2) \times (p - 3)! \equiv -1 \times (p - 2) \times (p - 3)! \pmod{p}$$

which justifies replacing the $p - 1$ with $-1$. Repeating this justifies the replacement of $p - 2$ with $-2$.

• Thank you so much but can you elborate on that alitle bit like why is that okay to do? I just can understand the reasoning behind it – Jamie John Mar 13 '17 at 17:50
• That's a good question. See my edited answer. – Michael Lugo Mar 13 '17 at 17:57