# Wilson's Theorem Factorial

I need to prove that $(1 \cdot 3 \cdot 5 \dotsm 2009)^2 - 1 \equiv 0 \pmod{2011}$

By modular simplification, I need to prove that $(3 \cdot 5 \cdot 7 \dotsm 2009) \equiv 1 \pmod{2011}$

I know that I need to link this to Wilson's theorem, so can someone nudge me in the right direction in the comments, and provide a solution?

• Notice: $2009 \equiv -2 \pmod {2011}$, $2007 \equiv -4 \pmod {2011}$ and so on and so forth. What factorials are involved in this, even though it appears as though there are only odd numbers? – Race Bannon Aug 6 '15 at 22:32
• It's $1005!$. Wilson's theorem tells us that, yes, but what about the fact that $1005 = \frac{p -1}{2}$? – Race Bannon Aug 6 '15 at 22:55
• Yeah, nevermind, got it :) – man_in_green_shirt Aug 6 '15 at 22:56
• I got that $2^{1005} * 1005! \equiv 1 \pmod{2011}$ – Saketh Malyala Aug 6 '15 at 23:15
• $2010!\equiv-1\mod2011$. But $2010!=1005!\cdot\displaystyle\prod_{1006}^{2010}k=1005!\cdot\prod_1^{1005}(2011-k)\equiv1005!\cdot\prod_1^{1005}(0-k)\equiv$ $\equiv(-1)^{1005}\cdot1005!^2\equiv-1005!^2\mod2011$. – Lucian Aug 7 '15 at 0:22

Since $2011$ is prime, Wilson's Theorem applies. Modulo $2011$ we have \eqalign{ (1\times3\times\cdots\times2009)^2 &=1\times3\times\cdots\times2009\times 1\times3\times\cdots\times2009\cr &\equiv1\times3\times\cdots\times2009 \times(-2010)\times(-2008)\times\cdots\times(-2)\cr &\equiv(-1)^{1005}(2010)!\cr &\equiv1\ .\cr}