0

I need to prove that if p is an odd prime and

$r = (p-1)/2$ then

$(r!)^2 ≡ (−1)^{r−1} \pmod p$

I think it has something to do with gauss's lemma

https://en.wikipedia.org/wiki/Gauss%27s_lemma_(number_theory)

but I tried a lot and couldn't find a way to break it .

any help or hint will be appreciated.

Bill Dubuque
  • 282,220
  • Special case $,h = (p-1)/2 = r,$ in the linked Wilson Reflection Formula. See also the comments here for the more difficult problem of determining $r!$ (i.e. the sign of the square root). – Bill Dubuque May 04 '23 at 19:19

1 Answers1

5

Hint: We have $p-1\equiv -1\pmod{p}$, $p-2\equiv -2\pmod{p}$, $p-3\equiv -3\pmod{p}$, and so on up to $\frac{p+1}{2}\equiv -\frac{p-1}{2}\pmod{p}$.

It follows that $$(p-1)!\equiv (-1)^{(p-1)/2}\left(\left(\frac{p-1}{2}\right)!\right)^2\pmod{p}.$$ Now use Wilson's Theorem.

André Nicolas
  • 514,336