Note: Due to changes in the Riesel prime template, most of those pages (and related) are not shown properly.This will take some time! Wanna help? Please move any Riesel prime page first, then edit/add the base parameter. |

**Navigation**

Topics | Register • News • History • How to • Sequences statistics • Template prototypes |

# Quadratic residue

In mathematics, a number `q` is called a **quadratic residue** modulo `p` if there exists an integer `x` such that:

- [math]\displaystyle{ {x^2}\equiv{q}\ (mod\ p) }[/math]

Otherwise, `q` is called a **quadratic non-residue**.

In effect, a quadratic residue modulo `p` is a number that has a square root in modular arithmetic when the modulus is `p`. The law of quadratic reciprocity says something about quadratic residues and primes.

Quadratic residues are used in the Legendre symbol. Quadratic reciprocity and the Gauss lemma both reason about quadratic residues.