If p is an odd prime, prove that 1^2 * 3^2 * 5^2 * ...(p-2)^2 = (-1)^(p+1)/2 (mod p)

and

2^2 * 4^2 * 6^2 * ... (p-1)^2 = (-1)^(p+1)/2 (mod p)

I know that (p-1)! = -1 mod p using Wilson's theorem, but then I am stuck. Help?

- Oct 2nd 2009, 04:56 PMkeityoProve that if p is an odd prime, 1^2 * 3^2 ...(p-2)^2 = (-1)^(p+1)/2 (mod p)
If p is an odd prime, prove that 1^2 * 3^2 * 5^2 * ...(p-2)^2 = (-1)^(p+1)/2 (mod p)

and

2^2 * 4^2 * 6^2 * ... (p-1)^2 = (-1)^(p+1)/2 (mod p)

I know that (p-1)! = -1 mod p using Wilson's theorem, but then I am stuck. Help? - Oct 2nd 2009, 06:18 PMBruno J.
For the first one : first, notice that $\displaystyle 1^2,3^2,...,(p-2)^2$ are all the squares in $\displaystyle \mathbb{F}_p=\mathbb{Z}/p\mathbb{Z}$. The squares of $\displaystyle \mathbb{F}_p$, by Euler's criterion, are the roots of the polynomial $\displaystyle f(x)=x^{(p-1)/2}-1$. Therefore, since $\displaystyle \mathbb{F}_p[x]$ is a unique factorization domain, we can factor this polynomial as :

$\displaystyle x^{(p-1)/2}-1 = (x-1^2)(x-3^2)...(x-(p-2)^2)$

Equating the constant terms, you get the theorem.

The second one is exactly the same. - Oct 2nd 2009, 08:09 PMkeityo
Very interesting information. The problem is that I haven't learned Euler's criterion in class yet, so I don't really understand your solution. I do know how to manipulate mods, use Wilson's Theorem, and Euler's generalization of Fermat's little theorem. Is there another way using only basic modular arithmetic and congruence to prove that 1^2 * 3^2 * 5^2 * ...(p-2)^2 = (-1)^(p+1)/2 (mod p) and 2^2 * 4^2 * 6^2 * ... (p-1)^2 = (-1)^(p+1)/2 (mod p) are both true? Thanks to all.

- Oct 3rd 2009, 05:18 AMPaulRS
Also, you can take a primitive root module $\displaystyle p$, call it $\displaystyle g$.

Since you have all the quadratic residues (*) there -in both cases-, and they are congruent to: $\displaystyle g^2,g^4, ..., g^{p-1}$ we find that both products are congruent to $\displaystyle g^2\cdot g^4 \cdot ...\cdot g^{p-1}=g^{2\cdot \sum_{k=1}^{\frac{p-1}{2}}{k}}=g^{\tfrac{p^2-1}{4}}$

But $\displaystyle g^{\tfrac{p-1}{2}}\equiv{-1}(\bmod.p)$ -since $\displaystyle g^{p-1}\equiv{1}(\bmod.p) $ and it's primitive- and so we find that the products are congruent to: $\displaystyle (g^{\tfrac{p-1}{2}})^{\tfrac{p+1}{2}}\equiv{(-1)^{\tfrac{p+1}{2}}}(\bmod.p)$

(*) $\displaystyle x$ is a quadratic residue module p if and only if there exist an integer $\displaystyle y$ such that $\displaystyle y^2\equiv{x}(\bmod.p)$

**EDIT:**What you have there is congruent to $\displaystyle 1^2\cdot 2^2\cdot ... \cdot \left(\tfrac{p-1}{2}\right)^2$ now note that $\displaystyle 1\equiv -(p-1)(\bmod.p)$ ... $\displaystyle \left(\tfrac{p-1}{2}\right)\equiv -(p-\left(\tfrac{p-1}{2}\right))(\bmod.p)$ but then we have: $\displaystyle 1^2\cdot 2^2\cdot ... \cdot \left(\tfrac{p-1}{2}\right)^2\equiv 1\cdot(-(p-1))\cdot ... \cdot \left(\tfrac{p-1}{2}\right)\cdot \left(p-\tfrac{p-1}{2}\right)\equiv (-1)^{\tfrac{p-1}{2}}\cdot (p-1)!$$\displaystyle \equiv{(-1)^{\tfrac{p+1}{2}}}(\bmod.p)$ (Happy) -just by applying Wilson's Theorem-