Number TheoryHonors · Lesson 03 / 16← Lesson 02Lesson 04 →
Lesson 03 · The multiplicative group · 55–70 minutes

Euler's Criterion and the Legendre Symbol

Half of the units mod p are squares. Lesson 02 identified them as the units of even index. Here that fact becomes a sign, the Legendre symbol (n/p) = ±1, which multiplies like a character and can be computed as a single power, n(p−1)/2 mod p, without finding a primitive root. Then Gauss's lemma, a counting argument with the floor function, decides exactly when −1 and 2 are squares. That picks out the primes used for the rest of the course.

Where this lesson is headed

(np) = (−1)ind n ≡ n(p−1)/2 (mod p),   (2p) = 1 ⇔ p ≡ ±1 (mod 8)

In words: being a square is a multiplicative sign, detected by one power. −1 is a square exactly when p ≡ 1 (mod 4), and 2 exactly when p ≡ ±1 (mod 8). The primes p > 5 with p ≡ 5 (mod 8), called P*, have −1 a square but 2 not; they are the primes of Parts III and IV.

You will use

n is a square mod p exactly when ind n is even, and the squares are half the units (Lesson 02, ℓ = 2). g(p−1)/2 ≡ −1 (Lesson 02, step 2). Wilson's theorem is not needed.

p: an odd prime

quadratic residue: a unit n ≡ x2 for some x; otherwise a nonresidue

(n/p): 1 for residues, −1 for nonresidues, 0 if p | n

⌊x⌋: the largest integer ≤ x

⟨m⟩: the remainder of m on division by p, in 0 to p − 1

P*: primes p > 5 with p ≡ 5 (mod 8)

01. Three ways to tell a square

Start with p = 13, the smallest prime of P*. The table computes (n/p) three independent ways: by listing squares, from the index, and by Euler's power n6. Then use Gauss's count on the right to decide whether 2 is a square without computing any powers.

The Legendre symbol, three ways

Gauss's count for a

Reduce a, 2a, …, ((p − 1)/2)a mod p and count how many land in the upper half, above p/2. Call the count μ.

μ (upper half)
(−1)μ
(a/p)

Guided experiments

Do these in order. "Set this up" chooses p and a.

    Why the floor function appears

    Dividing m by p gives a quotient and a remainder: m = p⌊m/p⌋ + ⟨m⟩, with 0 ≤ ⟨m⟩ ≤ p − 1. Gauss's lemma asks where the remainders ⟨ka⟩ fall, and its proof (and Lesson 10) turns that question into sums of floors.

    For negative m, ⌊m/p⌋ rounds down, so the remainder stays in 0 to p − 1: ⟨−1⟩ = p − 1.

    All three columns agree, and μ decides the sign. Stage 02 proves both.