Module 4 : Modular Arithmetic

Lecture 5 : Quadratic Residues

Theorem 2: [Euler] Let  and it is a quadratic residue if and only if 
Proof:  To prove the if part we assume that  is a quadratic residue. Thus it must an even power of g where g is a generator of . Let a be equal to g2k. Thus


For the only if part we assume that  is a non-quadratic residue. Thus it must be an odd power of g where g is a generator of Let a be equal to g2k+1. Thus

Since gp-1≡ 1 mod p and from Theorem 1  . Since g is the generator its order cannot be less than (p-1). Thus  and

Now the most natural question is what happens when n is composite. In other words how many roots are there of the equation x2 ≡ a mod n when n is a composite number. We have to consider two cases:

In both cases pi’s are all primes. From Theorem 1 we know that there are exactly 2 roots for each of the modular linear equation x2 ≡ 1 mod  ∀i (pi ≠ 2). Again we can easily prove the following for modular linear equations.