Number System

Quadratic Residue

Students compare small square tile patterns on a circular remainder dial.

Quadratic Residue definition

A quadratic residue modulo n is a residue class that can be obtained by squaring an integer modulo n.

In Spanish
residuo cuadrático
Topic
Prime numbers and number theory

Quadratic Residue in a picture

Quadratic Residue diagramThe distinct square remainders modulo 5 are 0, 1, and 4.0² leaves remainder 0Include zero when listing all squares1² and 4² leave remainder 1Opposite residues have equal squares2² and 3² leave remainder 4The full set is {0, 1, 4}
The distinct square remainders modulo 5 are 0, 1, and 4.

How it works

To test whether a is a square residue, ask if x² ≡ a (mod n) has an integer solution. Under the convention that includes zero, 0 is a square residue because 0² = 0. In treatments restricted to nonzero classes modulo a prime, 0 is listed separately.

Worked examples

Is 2 a square residue modulo 5?

No. The only square remainders are 0, 1, and 4.

Show that 4 is a square residue modulo 7.

Use 2² = 4, so x = 2 is a solution.

List all square remainders modulo 4.

They are 0 and 1, because even squares leave 0 and odd squares leave 1.

Common mistake

Square the input first, then reduce modulo n. A number that is not an ordinary integer square can still be congruent to a square.

Quick check

Which of 2, 3, and 4 is a square residue modulo 5?

Must an integer itself be a square to represent a square residue?

Show answer

No. It only needs to have the same remainder as a square.

What equation expresses the test?

Show answer

x² ≡ a (mod n) for some integer x.

Sources

Flashcard

Quadratic Residue

Reveal the definition

A quadratic residue modulo n is a residue class that can be obtained by squaring an integer modulo n.

Effortless Math. “Quadratic Residue.” Math Dictionary.