ArticleslgStudy

mathematics

Sum of two squares theorem

Sum of two squares theorem 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 Sum of two squares theorem rather than just read about it. In short: In number theory, the sum of two squares theorem relates the prime decomposition of any integer n > 1 to whether it can be written as a sum of two squares, such that n = a2 + b2 for some integers a, b. An integer greater than one can be written as a sum of two squares if and only if its prime decomposition contains no factor pk, where prime p≡3(mod4) and k is odd.

Sum of two squares theorem — main illustration
Sum of two squares theorem — illustration

Key takeaways

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

Reference excerpt

In number theory, the sum of two squares theorem relates the prime decomposition of any integer n > 1 to whether it can be written as a sum of two squares, such that n = a2 + b2 for some integers a, b.

An integer greater than one can be written as a sum of two squares if and only if its prime decomposition contains no factor pk, where prime p≡3(mod4) and k is odd. In writing a number as a sum of two squares, it is allowed for one of the squares to be zero, or for both of them to be equal to each other, so all squares and all doubles of squares are included in the numbers that can be represented in this way. This theorem supplements Fermat's theorem on sums of two squares which says when a prime number can be written as a sum of two squares, in that it also covers the case for composite numbers. A number may have multiple representations as a sum of two squares, counted by the sum of squares function; for instance, every Pythagorean triple a2+b2=c2 gives a second representation for c2 beyond the trivial representation c2+02.

Examples The prime decomposition of the number 2450 is given by 2450 = 2 · 52 · 72. Of the primes occurring in this decomposition, 2, 5, and 7, only 7 is congruent to 3 modulo 4. Its exponent in the decomposition, 2, is even. Therefore, the theorem states that it is expressible as the sum of two squares. Indeed, 2450 = 72 + 492. The prime decomposition of the number 3430 is 2 · 5 · 73. This time, the exponent of 7 in the decomposition is 3, an odd number. So 3430 cannot be written as the sum of two squares.

Representable numbers The numbers that can be represented as the sums of two squares form the integer sequence

0, 1, 2, 4, 5, 8, 9, 10, 13, 16, 17, 18, 20, 25, 26, 29, 32, ... They form the set of all norms of Gaussian integers; their square roots form the set of all lengths of line segments between pairs of points in the two-dimensional integer lattice. The number of representable numbers in the range from 0 to any number n is proportional to nlog⁡n, with a limiting constant of proportionality given by the Landau–Ramanujan constant, approximately 0.764. The product of any two representable numbers is another representable number. Its representation can be derived from representations of its two factors, using the Brahmagupta–Fibonacci identity.

Jacobi's two-square theorem Proved by Gauss using quadratic forms and Jacobi using elliptic functions. An elementary proof is based on the unique factorization of the Gaussian integers. Hirschhorn gives a short proof derived from the Jacobi triple product.

See also Legendre's three-square theorem Lagrange's four-square theorem Sum of squares function Brahmagupta–Fibonacci identity

References

Illustrations

Sum of two squares theorem: Integers satisfying the sum of two squares theorem are squares of possible distances between integer lattice points; values up to 100 are shown, with

•Squares (and thus integer distances) in red, and

•Non-unique representations (up to rotation and reflection) bolded
Integers satisfying the sum of two squares theorem are squares of possible distances between integer lattice points; values up to 100 are shown, with •Squares (and thus integer distances) in red, and •Non-unique representations (up to rotation and reflection) bolded

Worked examples

Example 1 — a first encounter with Sum of two squares theorem

Start with the simplest possible case. Write down what Sum of two squares theorem 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 Sum of two squares theorem 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 Sum of two squares theorem 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 Sum of two squares theorem

In research
Sum of two squares theorem 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 Sum of two squares theorem 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
Sum of two squares theorem is common in secondary-school and first-year university syllabi. It links to neighbouring topics Additive number theory, Squares in number theory, Theorems in number theory, so understanding it makes those chapters shorter.
In everyday life
Look for Sum of two squares theorem 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 “Sum of two squares theorem” →

How to study Sum of two squares theorem in 20 minutes

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

Frequently asked questions

What is Sum of two squares theorem in simple terms?

In number theory, the sum of two squares theorem relates the prime decomposition of any integer n > 1 to whether it can be written as a sum of two squares, such that n = a2 + b2 for some integers a, b. An integer greater than one can be written as a sum of two squares if and only if its prime decom…

Why does Sum of two squares theorem 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 Sum of two squares theorem?

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 Sum of two squares theorem.

Tags

  • Additive number theory
  • Squares in number theory
  • Theorems in number theory

Keep exploring