0

If $p$ is an odd prime, prove that $1^2\cdot3^2\cdot5^2\cdots(p-2)^2 \equiv (-1)^{(p+1)/2} \pmod p$

Then $$1^2\cdot3^2\cdot5^2\cdots(p-2)^2={1/16} (p-2)^2(3p-1)^2\tag{1}$$

Now since $p$ is odd then $(p+1)/2$ is even and $(-1)^{(p+1)/2}=1$. Now I tried substract $1$ from $(1)$ to find out if the result is a multiple of $p$. But I can't get the answer any suggestions.

Sil
  • 16,612
John757
  • 171

2 Answers2

2

The statement is false. For example, if $p = 5$ then $\frac{p+1}{2} = 3$ and $(-1)^3 = -1$, however $1^2 \times 2^2 \times 3^2 = 36$, and it is not true that $36 \equiv -1 \mod 5$.

For the true statement, consider the group of natural numbers less than or equal to $p$ modulo $p$ by multiplication i.e. $\{1,2,...,p-1\}$ under multiplication modulo $p$.

If we take the product of all the elements, then we see that every element is paired with its inverse except $1$ and $p-1$ (not very difficult to prove), whose product is $-1$ modulo $p$, giving Wilson's theorem.

However, if we exclude $p-1$, then every element is paired with its inverse, except the identity $1$ which does not contribute. Consequently, we get $(p-2)! \equiv 1 \mod p$ and so $((p-2)!)^2 \equiv 1 \mod p$.

For example, take $p=13$,then $11!$ leaves a remainder of $1$, therefore so does its square.

The right statement is that $(p-2)! \equiv 1 \mod p$ always, for $p$ a prime. Note that $0! = 1$ so this applies for $2$ as well.

orion2112
  • 594
0

Multiply both sides by $(p-1)^2$ for the equivalent:

$$1 = (p-1)^2 (-1)^{(p+1)/2} \text{ mod } p$$

where the left hand side was (the product of all nonzero elements modulo $p$)$^2 \equiv^{\star} (-1)^2 = 1$, and the right hand side expands to the product of: $p^2 - 2p + 1$ mod $p \equiv 1$, multiplied by $(-1)^{(p+1)/2}$.

And so we have the equivalent assertion:

$$1 = (-1)^{(p+1)/2} \text{ mod } p$$

which is, as pointed out already, false when $\frac{p+1}{2}$ is odd: for example, when $p=5$.

$^\star$: The asterisk for that particular equivalence is an application of Wilson's Theorem, for which you can find more discussion in (e.g.) MSE 307.