Module 4 : Modular Arithmetic

Lecture 5 : Quadratic Residues

Definition 1: An element a∈Z*p is called a quadratic residue if there are elements ±x∈Z*n such that x2 a mod n . Otherwise we call a to be a non-quadratic residue .

Lemma 1: Let p be an odd prime and g be the generator of Z*p . Then all even powers of g are quadratic residues and all odd powers of g are non-quadratic residues.

Proof: Let l = 2 k be an even number and clearly gl is a quadratic residue since (± gk )2gl mod n . Thus here x = gk . In contrast let l = 2 k + 1 be an odd number. We will prove that in this case gl is not a quadratic residue by contradiction. Assume otherwise, i.e., let gl be a quadratic residue. Thus there exists x = gm ∈Z*p such that x2 ≡ a mod n . Thus g2m g2k+1 mod p. Applying Theorem 1 in lecture-4 (Module -3) we have . Thus we have 2 m ≡ 2 k + 1 mod Φ(p). Thus we have 2 m≡ 2 k + 1 mod ( p -1). This implies ( p -1) | (2 m -2 k -1). Since p -1 is an even number and (2 m -2 k -1) is an odd number and an even number can not divide an odd number we have arrived at a contradiction. Thus our assumption that gl is a quadratic residue is not correct and hence it is a non-quadratic residue.

Theorem 1: Let p be an odd prim and e ≥ 1. Then the equation x2≡ 1 mod pe has only 2 solutions namely ±1.
Proof: Let g be the generator of the cyclic group . Thus we can rewrite our modular equation as . Thus from Theorem 1 in lecture-4 (Module-3) we have . We know Φ(pe) = pe-1 (p-1). Thus the given modular equation is solvable since gcd(2,  pe-1 (p-1)) = 2 | 0 and it has exactly 2 solutions namely ±1 (By Inspection).
Note that if n is an arbitrary composite number the equation x2 ≡ 1 mod n can have more than 2 solutions. For example if n = 15 then 4 and 11 are two non-trivial roots of the equation x2 ≡1 mod n besides 1 and 14. Later in Theorem 3 we will estimate the number of roots of the equation x2 ≡ 1 mod n when n is an arbitrary composite number.