4.II.6C

Numbers and Sets
Part IA, 2003

(i) Prove Wilson's theorem: if pp is prime then (p1)!1(modp)(p-1) ! \equiv-1(\bmod p).

Deduce that if p1(mod4)p \equiv 1(\bmod 4) then

((p12)!)21(modp)\left(\left(\frac{p-1}{2}\right) !\right)^{2} \equiv-1 \quad(\bmod p)

(ii) Suppose that pp is a prime of the form 4k+34 k+3. Show that if x41(modp)x^{4} \equiv 1(\bmod p) then x21(modp)x^{2} \equiv 1(\bmod p).

(iii) Deduce that if pp is an odd prime, then the congruence

x21(modp)x^{2} \equiv-1 \quad(\bmod p)

has exactly two solutions ( modulop)\operatorname{modulo} p) if p1(mod4)p \equiv 1(\bmod 4), and none otherwise.