# A question on square residue.

by MathematicalPhysicist
Tags: residue, square
 P: 3,217 I forgot why the next statement is true and it's bugging me endlessly... If p is prime such that p =1 mod 4 then (-1) = x^2 mod p. Now in Ashe's Algebriac Number theory notes (book?), he says that $$((\frac{p-1}{2})!)^2= -1 mod p$$ I am quite stumped as how to show this, he argues we just need to look at: 1*2*....((p-1)/2)*(-1)*(-2)....*(-(p-1)/2) which on the one hand because p =1 mod 4 it equals $$((\frac{p-1}{2})!)^2$$ on the other hand it also equals (p-1)!, but why does this equal -1? Thanks.