Take the 2-minute tour ×
Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

Assume $p$ is prime and $p\ge 3$.

Through experimentation, I can see that it's probably true. Using Wilson's theorem and Fermat's little theorem, it's equivalent to saying $2^2 4^2 6^2 \cdots (p-1)^2 = (-1)^{\frac{p+1}{2}}$ mod $p$, but I can't figure out any more than that.

share|improve this question

marked as duplicate by Grigory M, Claude Leibovici, Davide Giraudo, naslundx, Najib Idrissi May 2 at 12:41

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

5  
In Wilson's theorem $(p-1)(p-2)\dots 3\cdot 2\cdot 1 \equiv -1 \bmod p$, combine terms $k$ and $p-k$ together for $k=1,2,\dots,(p-1)/2$. Note $p-k \equiv -k \bmod p$. –  KCd Apr 13 '12 at 4:33
2  
@KCd: sounds like a very good answer to me, please move it below so that it can be accepted. –  Vadim Apr 13 '12 at 5:50
    
@KCd: Thanks! That was exactly what I needed. I'll mark it as accepted if you put that in an answer instead of a comment. –  Anonymous Apr 13 '12 at 7:51
add comment

1 Answer 1

$$(p-1)!=1\cdot2\cdots\frac{p-1}{2}\cdot\frac{p+1}{2}\cdots(p-2)(p-1)$$ We have the congruences $$\begin{align*} p-1&\equiv -1\pmod p\\ p-2&\equiv -2\pmod p\\ &\vdots\\ \frac{p+1}{2}&\equiv -\frac{p-1}{2}\pmod{p}\end{align*}$$ Rearranging the factors produces

$$(p-1)!\equiv 1\cdot(-1)\cdot2\cdot(-2)\cdots\frac{p-1}{2}\cdot\left(-\frac{p-1}{2}\right)\pmod p.$$ $\therefore (p-1)!\equiv (-1)^{\frac{p-1}{2}}\left(1\cdot2\cdots\frac{p-1}{2}\right)^{2}\pmod p.$ From Wilson's theorem, $(p-1)!\equiv -1\pmod{p}$ Thus $$-1\equiv (-1)^{\frac{p-1}{2}}\left[\left(\frac{p-1}{2}\right)!\right]^{2}\pmod{p}$$ It follows that $\left[\left(\frac{p-1}{2}\right)!\right]^{2}\equiv (-1)^{\frac{p+1}{2}}\pmod{p}$.

share|improve this answer
2  
$\LaTeX$ tip: \pmod{p} produces $\pmod{p}$, with appropriate spaces. –  Arturo Magidin Apr 16 '12 at 16:34
    
Thanks! I remember this! –  Kns Apr 16 '12 at 16:35
    
@ArturoMagidin: Thanks arturo for the $\LaTeX$ tip –  user9413 Apr 16 '12 at 17:23
add comment

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