ArticleslgStudy

science

Quadratic residue

Quadratic residue is a science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Quadratic residue rather than just read about it. In short: In number theory, an integer q is a quadratic residue modulo n if it is congruent to a perfect square modulo n; that is, if there exists an integer x such that x 2 ≡ q ( mod n ) . {\displaystyle x^{2}\equiv q{\pmod {n}}.} Otherwise, q is a quadratic nonresidue modulo n. Quadratic residues are used in applications ranging from acoustical engineering to cryptography and the factoring of large numbers.

Key takeaways

  • Quadratic residue belongs to science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Quadratic residue to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Quadratic residue from memory before moving on to harder problems.

Reference excerpt

In number theory, an integer q is a quadratic residue modulo n if it is congruent to a perfect square modulo n; that is, if there exists an integer x such that

x 2 ≡ q ( mod n ) . {\displaystyle x^{2}\equiv q{\pmod {n}}.}

Otherwise, q is a quadratic nonresidue modulo n. Quadratic residues are used in applications ranging from acoustical engineering to cryptography and the factoring of large numbers.

History, conventions, and elementary facts Fermat, Euler, Lagrange, Legendre, and other number theorists of the 17th and 18th centuries established theorems and formed conjectures about quadratic residues, but the first systematic treatment is § IV of Gauss's Disquisitiones Arithmeticae (1801). Article 95 introduces the terminology "quadratic residue" and "quadratic nonresidue", and says that if the context makes it clear, the adjective "quadratic" may be dropped. For a given n, a list of the quadratic residues modulo n may be obtained by simply squaring all the numbers 0, 1, ..., n − 1. Since a ≡ b (mod n) implies a2≡b2 (mod n), any other quadratic residue is congruent (mod n) to some in the obtained list. But the obtained list is not composed of mutually incongruent quadratic residues (mod n) only. Since a2≡(n−a)2 (mod n), the list obtained by squaring all numbers in the list 1, 2, ..., n − 1 (or in the list 0, 1, ..., n) is symmetric (mod n) around its midpoint, hence it is actually only needed to square all the numbers in the list 0 , 1 , . . . , ⌊ n / 2 ⌋ {\displaystyle 0,1,...,\lfloor n/2\rfloor } . The list so obtained may still contain mutually congruent numbers (mod n). Thus, the number of mutually noncongruent quadratic residues modulo n cannot exceed n/2 + 1 (n even) or (n + 1)/2 (n odd). The product of two residues is always a residue.

Prime modulus Modulo an odd prime number p there are (p + 1)/2 residues (including 0) and (p − 1)/2 nonresidues, by Euler's criterion. In this case, it is customary to consider 0 as a special case and work within the multiplicative group of nonzero elements of the field ( Z / p Z ) {\displaystyle (\mathbb {Z} /p\mathbb {Z} )} . In other words, every congruence class except zero modulo p has a multiplicative inverse. This is not true for composite moduli. Following this convention, the multiplicative inverse of a residue is a residue, and the inverse of a nonresidue is a nonresidue. Following this convention, modulo an odd prime number there is an equal number of residues and nonresidues. Modulo a prime, the product of two nonresidues is a residue and the product of a nonresidue and a (nonzero) residue is a nonresidue. The first supplement to the law of quadratic reciprocity is that if p ≡ 1 (mod 4) then −1 is a quadratic residue modulo p, and if p ≡ 3 (mod 4) then −1 is a nonresidue modulo p. This implies the following: If p ≡ 1 (mod 4) the negative of a residue modulo p is a residue and the negative of a nonresidue is a nonresidue. If p ≡ 3 (mod 4) the negative of a residue modulo p is a nonresidue and the negative of a nonresidue is a residue.

Prime power modulus All odd squares are ≡ 1 (mod 8) and thus also ≡ 1 (mod 4). If a is an odd number and m = 8, 16, or some higher power of 2, then a is a residue modulo m if and only if a ≡ 1 (mod 8).

For example, mod (32) the odd squares are 12 ≡ 152 ≡ 1 32 ≡ 132 ≡ 9 52 ≡ 112 ≡ 25 72 ≡ 92 ≡ 49 ≡ 17 and the even ones are

02 ≡ 82 ≡ 162 ≡ 0 22 ≡ 62≡ 102 ≡ 142≡ 4 42 ≡ 122 ≡ 16.

So a nonzero number is a residue mod 8, 16, etc., if and only if it is of the form 4k(8n + 1). A number a relatively prime to an odd prime p is a residue modulo any power of p if and only if it is a residue modulo p. If the modulus is pn,

then pka is a residue modulo pn if k ≥ n is a nonresidue modulo pn if k < n is odd is a residue modulo pn if k < n is even and a is a residue is a nonresidue modulo pn if k < n is even and a is a nonresidue. Notice that the rules are different for powers of two and powers of odd primes. Modulo an odd prime power n = pk, the products of residues and nonresidues relatively prime to p obey the same rules as they do mod p; p is a nonresidue, and in general all the residues and nonresidues obey the same rules, except that the products will be zero if the power of p in the product ≥ n. Modulo 8, the product of the nonresidues 3 and 5 is the nonresidue 7, and likewise for permutations of 3, 5 and 7. In fact, the multiplicative group of the non-residues and 1 form the Klein four-group.

Composite modulus not a prime power The basic fact in this case is

if a is a residue modulo n, then a is a residue modulo pk for every prime power dividing n. if a is a nonresidue modulo n, then a is a nonresidue modulo pk for at least one prime power dividing n. Modulo a composite number, the product of two residues is a residue. The product of a residue and a nonresidue may be a residue, a nonresidue, or zero.

For example, from the table for modulus 6 1, 2, 3, 4, 5 (residues in bold). The product of the residue 3 and the nonresidue 5 is the residue 3, whereas the product of the residue 4 and the nonresidue 2 is the nonresidue 2.

Also, the product of two nonresidues may be either a residue, a nonresidue, or zero.

For example, from the table for modulus 15 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14 (residues in bold). The product of the nonresidues 2 and 8 is the residue 1, whereas the product of the nonresidues 2 and 7 is the nonresidue 14.

… excerpt ends here. Continue reading the full article.

Worked examples

Example 1 — a first encounter with Quadratic residue

Start with the simplest possible case. Write down what Quadratic residue claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Quadratic residue before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Quadratic residue ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Quadratic residue

In research
Quadratic residue appears in science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Quadratic residue in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Quadratic residue is common in secondary-school and first-year university syllabi. It links to neighbouring topics Modular arithmetic, NP-complete problems, Quadratic residue, so understanding it makes those chapters shorter.
In everyday life
Look for Quadratic residue outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.

Affiliate

Preply — study more efficiently by working with a personal tutor. 50% off.

How to study Quadratic residue in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Quadratic residue means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Quadratic residue out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Quadratic residue in simple terms?

In number theory, an integer q is a quadratic residue modulo n if it is congruent to a perfect square modulo n; that is, if there exists an integer x such that x 2 ≡ q ( mod n ) . {\displaystyle x^{2}\equiv q{\pmod {n}}.} Otherwise, q is a quadratic nonresidue modulo n. Quadratic residues are used…

Why does Quadratic residue matter?

Because it connects several science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Quadratic residue?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Quadratic residue.

Tags

  • Modular arithmetic
  • NP-complete problems
  • Quadratic residue

Keep exploring