Quadratic Residues

Explore Quadratic Residues with interactive visualizations. Learn Legendre symbols, quadratic reciprocity law, applications in cryptography, and primality testing through hands-on examples and real-world applications.

Quadratic Residues Number Theory Mathematics Analysis Problem Solving Interactive Learning

What are Quadratic Residues?

In number theory, a quadratic residue modulo n is any integer q that is congruent to a perfect square modulo n. That is, there exists an integer x such that x² ≡ q (mod n). If no such x exists, q is called a quadratic non-residue modulo n.

The concept is fundamental in number theory and has significant applications in cryptography, primality testing, and integer factorization. The Legendre symbol provides a convenient notation for determining whether a number is a quadratic residue modulo a prime.

Perfect Squares Congruence Relations Prime Moduli Legendre Symbol Quadratic Reciprocity

Concept Visualization

Interactive visualizations to understand quadratic residues and Legendre symbols

Quadratic Residue Checker

Enter a number and modulus to check if it's a quadratic residue

Legendre Symbol Calculator

Calculate the Legendre symbol (a/p) for given values

Quadratic Residues Visualization

Quadratic Reciprocity Visualization

Legendre Symbol Properties:
  • (a/p) = 1 if a is a quadratic residue modulo p and a ≢ 0 (mod p)
  • (a/p) = -1 if a is a quadratic non-residue modulo p
  • (a/p) = 0 if a ≡ 0 (mod p)
  • Quadratic Reciprocity Law: For distinct odd primes p and q, (p/q)(q/p) = (-1)^((p-1)/2)((q-1)/2)

Step-by-Step Process

Understanding the calculation process with interactive components

1. Definition

Quadratic Residues

2. Legendre Symbol

Notation System

3. Calculation

Euler's Criterion

4. Reciprocity

Fundamental Law

Step 1: Understanding Quadratic Residues

A number a is a quadratic residue modulo p if there exists an integer x such that x² ≡ a (mod p).

For example, with modulus 7:

  • 1² ≡ 1 (mod 7) → 1 is a quadratic residue
  • 2² ≡ 4 (mod 7) → 4 is a quadratic residue
  • 3² ≡ 2 (mod 7) → 2 is a quadratic residue
  • 4² ≡ 2 (mod 7) → 2 is a quadratic residue
  • 5² ≡ 4 (mod 7) → 4 is a quadratic residue
  • 6² ≡ 1 (mod 7) → 1 is a quadratic residue

Therefore, the quadratic residues modulo 7 are {1, 2, 4}, and the non-residues are {3, 5, 6}.

Calculators & Converters

Advanced tools for computing quadratic residues and related concepts

Jacobi Symbol Calculator

Generalization of Legendre symbol for composite moduli

Quadratic Residues List Generator

Generate all quadratic residues for a given prime modulus

Primality Test Using Quadratic Residues

Solovay-Strassen primality test based on Euler's criterion

Applications & Examples

Real-world applications of quadratic residues in various fields

Cryptography & Security

Quadratic residues form the mathematical foundation for several cryptographic protocols and security mechanisms.

RSA Encryption Key Exchange Digital Signatures
  • Rabin cryptosystem based on the difficulty of computing square roots modulo a composite number
  • Goldwasser-Micali probabilistic encryption scheme using quadratic residuosity problem
  • Blum-Goldwasser cryptosystem for secure communication
  • Commitment schemes in zero-knowledge proofs
  • Hash functions and pseudorandom number generation
Primality Testing & Factorization

Number theory enables efficient algorithms for determining primality and factoring integers.

Primality Tests Integer Factorization Probabilistic Algorithms
  • Solovay-Strassen probabilistic primality test using Euler's criterion
  • Miller-Rabin primality test with quadratic residues
  • Shanks-Tonelli algorithm for computing square roots modulo primes
  • Pollard's rho algorithm for integer factorization
  • Quadratic sieve factorization method

Differences from Related Fields

Understanding how quadratic residues relate to and differ from other mathematical concepts

vs. Modular Arithmetic

  • Modular Arithmetic: General study of operations under modular congruences
  • Quadratic Residues: Specific focus on squares and their properties in modular systems
  • Modular arithmetic covers all operations (+, -, ×, ÷), while quadratic residues focus specifically on squaring
  • Quadratic residues are a specialized subset of modular arithmetic with unique properties

vs. Diophantine Equations

  • Diophantine Equations: Study of integer solutions to polynomial equations
  • Quadratic Residues: Focus on solvability of x² ≡ a (mod n)
  • Diophantine equations cover broader polynomial forms, while quadratic residues specifically address quadratic congruences
  • Quadratic residues provide tools for determining solvability of certain Diophantine equations

Example Exercises

Practice problems with step-by-step solutions

Problem: Determine if 5 is a quadratic residue modulo 11.

Solution:

We need to check if there exists an integer x such that x² ≡ 5 (mod 11).

We can compute the squares of all integers from 1 to 10 (since we're working modulo 11):

  • 1² ≡ 1 (mod 11)
  • 2² ≡ 4 (mod 11)
  • 3² ≡ 9 (mod 11)
  • 4² ≡ 16 ≡ 5 (mod 11)
  • 5² ≡ 25 ≡ 3 (mod 11)
  • 6² ≡ 36 ≡ 3 (mod 11)
  • 7² ≡ 49 ≡ 5 (mod 11)
  • 8² ≡ 64 ≡ 9 (mod 11)
  • 9² ≡ 81 ≡ 4 (mod 11)
  • 10² ≡ 100 ≡ 1 (mod 11)

Since 4² ≡ 5 (mod 11) and 7² ≡ 5 (mod 11), we conclude that 5 is a quadratic residue modulo 11.

Problem: Compute the Legendre symbol (7/11).

Solution:

We'll use Euler's criterion: (a/p) ≡ a((p-1)/2) (mod p)

For (7/11), we compute 7((11-1)/2) = 7⁵ (mod 11):

  • 7¹ ≡ 7 (mod 11)
  • 7² ≡ 49 ≡ 5 (mod 11)
  • 7³ ≡ 7 × 5 ≡ 35 ≡ 2 (mod 11)
  • 7⁴ ≡ 7 × 2 ≡ 14 ≡ 3 (mod 11)
  • 7⁵ ≡ 7 × 3 ≡ 21 ≡ 10 ≡ -1 (mod 11)

Since 7⁵ ≡ -1 (mod 11), we conclude that (7/11) = -1, which means 7 is a quadratic non-residue modulo 11.

Problem: Compute (11/17) using quadratic reciprocity.

Solution:

The law of quadratic reciprocity states that for distinct odd primes p and q:

(p/q)(q/p) = (-1)((p-1)/2)((q-1)/2)

For (11/17), we have p=11 and q=17:

(11/17)(17/11) = (-1)((11-1)/2)((17-1)/2) = (-1)5×8 = (-1)40 = 1

Therefore, (11/17) = (17/11).

Now we compute (17/11) = (6/11) since 17 ≡ 6 (mod 11).

We can factor 6 = 2 × 3, so (6/11) = (2/11)(3/11).

Using the supplementary law for (2/11): Since 11 ≡ 3 (mod 8), we have (2/11) = -1.

For (3/11), using Euler's criterion: 3⁵ = 243 ≡ 1 (mod 11), so (3/11) = 1.

Therefore, (6/11) = (-1)(1) = -1.

We conclude that (11/17) = -1, which means 11 is a quadratic non-residue modulo 17.

Multiple Choice Questions

Test your understanding of quadratic residues

Question 1: Which of the following is a quadratic residue modulo 7?
Question 2: What is the value of the Legendre symbol (3/7)?
Question 3: How many quadratic residues are there modulo 13?
Question 4: If p is an odd prime and a ≡ 0 (mod p), what is the value of (a/p)?
Question 5: Which statement about quadratic reciprocity is true?
Question 6: What does it mean for a to be a quadratic residue modulo p?

Data Export & Import

Save and share your calculations and visualizations

Export Your Work

Save your quadratic residues calculations and visualizations for future reference or sharing

Import Previous Work

Load previously saved quadratic residues data