If $p\equiv 3\pmod{4}$ is a prime, then $\frac{p-1}{2}! \equiv \pm1 \pmod p$.

I don't know how to prove this statement.

$p=4m+3$, so $(2m+1)! \equiv \pm1\pmod p$

This is all I did.

  • 1
    $\begingroup$ Do you know Wilson's theorem? $\endgroup$ – Daniel Fischer Oct 18 '15 at 12:42
  • $\begingroup$ Shall I interpret that as "No, I'm new to the topic, I haven't yet heard of it"? $\endgroup$ – Daniel Fischer Oct 18 '15 at 12:45
  • $\begingroup$ Related: Why does $(\frac{p-1}{2}!)^2 = (-1)^{\frac{p+1}{2}}$ mod $p$?; probably there are more similar duplicates $\endgroup$ – punctured dusk Oct 18 '15 at 12:47
  • $\begingroup$ $p\text{ is prime}\iff (p-1)!+1\equiv0\pmod{p}$ $\endgroup$ – barak manos Oct 18 '15 at 12:59
  • $\begingroup$ And you should most definitely change $(p-1/2)!$ to $((p-1)/2)!$ $\endgroup$ – barak manos Oct 18 '15 at 13:05

$\left( \frac{p-1}{2}! \right)^2 = \prod \limits_{n=1}^{\frac{p-1}{2}}n·\prod \limits_{n=1}^{\frac{p-1}{2}}n=\prod \limits_{n=1}^{\frac{p-1}{2}}n·\prod \limits_{n=1}^{\frac{p-1}{2}}-n \equiv\prod \limits_{n=1}^{\frac{p-1}{2}}n·\prod \limits_{n=\frac{p+1}{2}}^{p-1}n=(p-1)! \equiv 1$

You can change $n$ for $-n$ because there is an even number of factors from $1$ to $\frac{n-1}{2}$

Therefore, $ \frac{p-1}{2}!$ is congruent to either $1$ or $-1$


Wilson's theorem

$$(p-1)!\equiv_p -1$$

Proof: Every element $x\in\Bbb Z_p^\times$ has a unique inverse $y\in\Bbb Z_p^\times$ such that $xy\equiv_p 1$, except $-1,1$ since they are their own inverses, i.e., they satisfy $x^2\equiv_p 1$.

This inverse is unique, since if both $y,y'$ were inverses of $x$, then $$xy\equiv_p xy'\equiv_p 1\Rightarrow y\equiv_p y'$$ Now in the product $(p-1)!$ every element is multiplied with it's corresponding inverse, except $-1$ and $1$, which means $$(p-1)!\equiv_p 1\cdot 1\cdot\ldots\cdot 1\cdot (-1)\equiv_p -1$$

$(p-1)!\equiv_p 1\cdot (-1)\cdot 2\cdot (-2)\cdot \ldots\cdot \frac{p-1}{2}\cdot (-\frac{p-1}{2})\equiv_p (-1)^{\frac{p-1}{2}}\left (\frac{p-1}{2}\right )!^2$

By Wilson's theorem $-1\equiv_p(-1)^{\frac{p-1}{2}}\left (\frac{p-1}{2}\right )!^2$

Using that $p\equiv_4 3$ we get $$\left (\frac{p-1}{2}\right )!\equiv_p \pm1$$

  • $\begingroup$ Could you explain me the last part? I don’t see how using $p \equiv 3 \pmod 4$ you obtain that result. Thank you $\endgroup$ – Octavio Berlanga Aug 5 at 22:17
  • 1
    $\begingroup$ @OctavioBerlanga If $p\equiv_4 3$ then $(-1)^{\frac{p-1}{2}}=-1$, thus you get $1\equiv_p \left(\frac{p-1}{2}\right)!^2$. Are you satisfied? $\endgroup$ – cansomeonehelpmeout Aug 6 at 12:34
  • 1
    $\begingroup$ I am satisfied, thank you. $\endgroup$ – Octavio Berlanga Aug 6 at 16:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.