ArticleslgStudy

mathematics

Euler's criterion

Euler's criterion is a mathematics 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 Euler's criterion rather than just read about it. In short: In number theory, Euler's criterion is a formula for determining whether an integer is a quadratic residue modulo a prime. Precisely, Let p be an odd prime and a be an integer coprime to p.

Key takeaways

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

Reference excerpt

In number theory, Euler's criterion is a formula for determining whether an integer is a quadratic residue modulo a prime. Precisely, Let p be an odd prime and a be an integer coprime to p. Then ap−12≡{1(modp) if there is an integer x such that x2≡a(modp),−1(modp) if there is no such integer. Euler's criterion can be concisely reformulated using the Legendre symbol: (ap)≡ap−12(modp). The criterion dates from a 1748 paper by Leonhard Euler.

Proof The proof uses the fact that the residue classes modulo a prime number are a field. See the article prime field for more details. Because the modulus is prime, Lagrange's theorem applies: a polynomial of degree k can only have at most k roots. In particular, x2 ≡ a (mod p) has at most 2 solutions for each a. This immediately implies that besides 0 there are at least ⁠p − 1/2⁠ distinct quadratic residues modulo p: each of the p − 1 possible values of x can only be accompanied by one other to give the same residue. In fact, (p−x)2≡x2(modp). This is because (p−x)2≡p2−2xp+x2≡x2(modp). So, the p−12 distinct quadratic residues are: 12,22,...,(p−12)2(modp). As a is coprime to p, Fermat's little theorem says that ap−1≡1(modp), which can be written as (ap−12−1)(ap−12+1)≡0(modp). Since the integers mod p form a field, for each a, one or the other of these factors must be zero. Therefore, ap−12≡1(modp) or ap−12≡−1(modp). Now if a is a quadratic residue, a ≡ x2, ap−12≡(x2)p−12≡xp−1≡1(modp). So every quadratic residue (mod p) makes the first factor zero. Applying Lagrange's theorem again, we note that there can be no more than ⁠p − 1/2⁠ values of a that make the first factor zero. But as we noted at the beginning, there are at least ⁠p − 1/2⁠ distinct quadratic residues (mod p) (besides 0). Therefore, they are precisely the residue classes that make the first factor zero. The other ⁠p − 1/2⁠ residue classes, the nonresidues, must make the second factor zero, or they would not satisfy Fermat's little theorem. This is Euler's criterion.

Alternative proof This proof only uses the fact that any congruence kx≡l(modp) has a unique (modulo p) solution x provided p does not divide k. (This is true because as x runs through all nonzero remainders modulo p without repetitions, so does kx: if we have kx1≡kx2(modp), then p∣k(x1−x2), hence p∣(x1−x2), but x1 and x2 aren't congruent modulo p.) It follows from this fact that all nonzero remainders modulo p the square of which isn't congruent to a can be grouped into unordered pairs (x,y) according to the rule that the product of the members of each pair is congruent to a modulo p (since by this fact for every y we can find such an x, uniquely, and vice versa, and they will differ from each other if y2 is not congruent to a). If a is not a quadratic residue, this is simply a regrouping of all p−1 nonzero residues into (p−1)/2 pairs, hence we conclude that 1⋅2⋅...⋅(p−1)≡ap−12(modp). If a is a quadratic residue, exactly two remainders were not among those paired, r and −r such that r2≡a(modp). If we pair those two absent remainders together, their product will be −a rather than a, whence in this case 1⋅2⋅...⋅(p−1)≡−ap−12(modp). In summary, considering these two cases we have demonstrated that for a≢0(modp) we have 1⋅2⋅...⋅(p−1)≡−(ap)ap−12(modp). It remains to substitute a=1 (which is obviously a square) into this formula to obtain at once Wilson's theorem, Euler's criterion, and (by squaring both sides of Euler's criterion) Fermat's little theorem.

Examples Example 1: Finding primes for which a is a residue Let a = 17. For which primes p is 17 a quadratic residue? We can test prime p's manually given the formula above. In one case, testing p = 3, we have 17(3 − 1)/2 = 171 ≡ 2 ≡ −1 (mod 3), therefore 17 is not a quadratic residue modulo 3. In another case, testing p = 13, we have 17(13 − 1)/2 = 176 ≡ 1 (mod 13), therefore 17 is a quadratic residue modulo 13. As confirmation, note that 17 ≡ 4 (mod 13), and 22 = 4. We can do these calculations faster by using various modular arithmetic and Legendre symbol properties. If we keep calculating the values, we find:

(17/p) = +1 for p = {13, 19, ...} (17 is a quadratic residue modulo these values) (17/p) = −1 for p = {3, 5, 7, 11, 23, ...} (17 is not a quadratic residue modulo these values). Example 2: Finding residues given a prime modulus p Which numbers are squares modulo 17 (quadratic residues modulo 17)? We can manually calculate it as:

12 = 1 22 = 4 32 = 9 42 = 16 52 = 25 ≡ 8 (mod 17) 62 = 36 ≡ 2 (mod 17) 72 = 49 ≡ 15 (mod 17) 82 = 64 ≡ 13 (mod 17). So the set of the quadratic residues modulo 17 is {1,2,4,8,9,13,15,16}. Note that we did not need to calculate squares for the values 9 through 16, as they are all negatives of the previously squared values (e.g. 9 ≡ −8 (mod 17), so 92 ≡ (−8)2 = 64 ≡ 13 (mod 17)). We can find quadratic residues or verify them using the above formula. To test if 2 is a quadratic residue modulo 17, we calculate 2(17 − 1)/2 = 28 ≡ 1 (mod 17), so it is a quadratic residue. To test if 3 is a quadratic residue modulo 17, we calculate 3(17 − 1)/2 = 38 ≡ 16 ≡ −1 (mod 17), so it is not a quadratic residue. Euler's criterion is related to the law of quadratic reciprocity.

Applications In practice, it is more efficient to use an extended variant of Euclid's algorithm to calculate the Jacobi symbol (an). If n is an odd prime, this is equal to the Legendre symbol, and decides whether a is a quadratic residue modulo n. On the other hand, since the equivalence of an−12 to the Jacobi symbol holds for all odd primes, but not necessarily for composite numbers, calculating both and comparing them can be used as a primality test, specifically the Solovay–Strassen primality test. Composite numbers for which the congruence holds for a given a are called Euler–Jacobi pseudoprimes to base a.

Notes

References The Disquisitiones Arithmeticae has been translated from Gauss's Ciceronian Latin into English and German. The German edition includes all of his papers on number theory: all the proofs of quadratic reciprocity, the determination of the sign of the Gauss sum, the investigations into biquadratic reciprocity, and unpublished notes.

… excerpt ends here. Continue reading the full article.

Worked examples

Example 1 — a first encounter with Euler's criterion

Start with the simplest possible case. Write down what Euler's criterion claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In mathematics, 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 Euler's criterion 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 Euler's criterion 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 Euler's criterion

In research
Euler's criterion appears in mathematics 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 Euler's criterion 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
Euler's criterion is common in secondary-school and first-year university syllabi. It links to neighbouring topics Modular arithmetic, Quadratic residue, Squares in number theory, so understanding it makes those chapters shorter.
In everyday life
Look for Euler's criterion 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.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “Euler's criterion” →

How to study Euler's criterion in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Euler's criterion 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 Euler's criterion out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Euler's criterion in simple terms?

In number theory, Euler's criterion is a formula for determining whether an integer is a quadratic residue modulo a prime. Precisely, Let p be an odd prime and a be an integer coprime to p.

Why does Euler's criterion matter?

Because it connects several mathematics 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 Euler's criterion?

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 Euler's criterion.

Tags

  • Modular arithmetic
  • Quadratic residue
  • Squares in number theory
  • Theorems about prime numbers

Keep exploring