Understanding Square Residue: Solving the Mystery of -1 = x^2 mod p

In summary, the author says that if p is prime such that p =1 mod 4 then (-1) = x^2 mod p. However, he argues that this is true because 1,2,3,...,p-1 are all residue classes mod p, so for each number in the product, its inverse is also a factor for all numbers which are not their own inverse. Thus 2*3*...*(p-2) = 1.
  • #1
MathematicalPhysicist
Gold Member
4,699
373
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
[tex]((\frac{p-1}{2})!)^2= -1 mod p[/tex]

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 [tex]((\frac{p-1}{2})!)^2 [/tex]
on the other hand it also equals (p-1)!, but why does this equal -1?

Thanks.
 
Physics news on Phys.org
  • #2
x2modp is not -1 for all x. Examples of exceptions include p=13, x=4; p=13 x=2; p=101, x=5...
 
  • #3
cubzar, what he meant was that there is a solution to x^2 = -1 mod p.

It's because (p-1)! = -1 mod p for all prime p. I believe this is called wilsons theorem. The reasons why this is true is that 1,2,3,...,p-1 are all residue classes mod p, so for each number in the product, its inverse is also a factor for all numbers which are not their own inverse. These are 1 and -1 = p-1, so we can ignore them and pair up the others. Thus 2*3*...*(p-2) = 1, and so (p-1)! = -1.
 
  • #4
Ok, thanks, now I do get it.
in 2*3*...*(p-2) we have a number and its inverse multiplied together, this is why it equals 1.

I don't understand how I didn't notice this triviality, I guess the age does it trick... :-(
 
  • #5
MathematicalPhysicist said:
Ok, thanks, now I do get it.
in 2*3*...*(p-2) we have a number and its inverse multiplied together, this is why it equals 1.

I don't understand how I didn't notice this triviality, I guess the age does it trick... :-(

I don't think it is your fault, the author should have explained it instead of showing off. This is the problem with mathematicians, they write books as incomplete instruction manuals and expect the reader to fill in the gaps.
:smile:
 

FAQ: Understanding Square Residue: Solving the Mystery of -1 = x^2 mod p

What is a square residue?

A square residue is the remainder when a number is squared and divided by another number. For example, in the equation x^2 mod p, the square residue is the value of x^2 when divided by p.

Why is -1 a special case in the equation x^2 mod p?

In the equation x^2 mod p, -1 is a special case because it is the only value that remains unchanged when squared and divided by any prime number p. This makes it a useful tool in understanding the properties of prime numbers.

What is the significance of understanding square residues in solving mathematical problems?

Understanding square residues is important in solving a variety of mathematical problems, particularly in number theory and cryptography. It allows for the identification of patterns and relationships between numbers, which can lead to the development of new mathematical theories and techniques.

How is the mystery of -1 = x^2 mod p being solved?

The mystery of -1 = x^2 mod p is being solved through the use of advanced mathematical techniques and algorithms. This involves analyzing large sets of data, identifying patterns, and testing various hypotheses to ultimately arrive at a solution.

What are some potential applications of the understanding of square residues?

The understanding of square residues has a wide range of potential applications, including in cryptography, prime number generation, and error-correcting codes. It can also be used to develop more efficient algorithms for solving mathematical problems and to improve the security of digital systems.

Back
Top