# Thread: Prove that if p is an odd prime, 1^2 * 3^2 ...(p-2)^2 = (-1)^(p+1)/2 (mod p)

1. ## Prove 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?

2. For the first one : first, notice that $1^2,3^2,...,(p-2)^2$ are all the squares in $\mathbb{F}_p=\mathbb{Z}/p\mathbb{Z}$. The squares of $\mathbb{F}_p$, by Euler's criterion, are the roots of the polynomial $f(x)=x^{(p-1)/2}-1$. Therefore, since $\mathbb{F}_p[x]$ is a unique factorization domain, we can factor this polynomial as :

$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.

3. 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.

4. Also, you can take a primitive root module $p$, call it $g$.

Since you have all the quadratic residues (*) there -in both cases-, and they are congruent to: $g^2,g^4, ..., g^{p-1}$ we find that both products are congruent to $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 $g^{\tfrac{p-1}{2}}\equiv{-1}(\bmod.p)$ -since $g^{p-1}\equiv{1}(\bmod.p)$ and it's primitive- and so we find that the products are congruent to: $(g^{\tfrac{p-1}{2}})^{\tfrac{p+1}{2}}\equiv{(-1)^{\tfrac{p+1}{2}}}(\bmod.p)$

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

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

,

,

,

,

# using wilson's theorem prove that for any odd prime p

Click on a term to search for related topics.