What Is 4 square theorem
Content on WhatAnswers is provided "as is" for informational purposes. While we strive for accuracy, we make no guarantees. Content is AI-assisted and should not be used as professional advice.
Last updated: April 17, 2026
Key Facts
- Joseph-Louis Lagrange proved the Four Square Theorem in 1770.
- The theorem applies to all natural numbers, including zero.
- Some numbers require all four squares, like 7 = 2² + 1² + 1² + 1².
- Adrien-Marie Legendre extended the theorem in 1798 with the three-square case.
- The theorem is a foundational result in number theory and Diophantine equations.
Overview
The Four Square Theorem, also known as Lagrange's Four Square Theorem, is a foundational result in number theory. It asserts that every positive integer can be written as the sum of at most four perfect squares. This includes zero as a valid square (0² = 0), allowing combinations like 5 = 2² + 1² + 0² + 0².
First proven in 1770 by Joseph-Louis Lagrange, the theorem resolved a conjecture that had intrigued mathematicians since the time of Diophantus. Its elegance lies in its universality—no matter how large the number, four squares are always sufficient. The theorem does not require all four squares to be nonzero, but some numbers, like 7, use all four.
- Proof date: Joseph-Louis Lagrange completed the proof in 1770, marking a milestone in algebraic number theory.
- Mathematical scope: The theorem applies to all natural numbers, including 1, 2, 3, and beyond, without exception.
- Example case: The number 30 can be expressed as 5² + 2² + 1² + 0² = 25 + 4 + 1 + 0.
- Historical roots: The problem appeared in Diophantus’ Arithmetica, influencing Fermat and Euler before Lagrange’s proof.
- Computational use: Modern algorithms use the theorem in integer decomposition and cryptographic applications.
How It Works
The theorem relies on algebraic identities and properties of quadratic forms. By leveraging Euler’s four-square identity, Lagrange showed that if all primes can be written as sums of four squares, then so can all integers.
- Prime decomposition:Every prime number can be expressed as a sum of four squares, which extends to composites via multiplication.
- Euler’s identity: The product of two numbers, each a sum of four squares, is itself a sum of four squares—critical for proof.
- Use of zero: The inclusion of 0² allows representations like 9 = 3² + 0² + 0² + 0², simplifying expressions.
- Non-uniqueness: Most numbers have multiple representations; for example, 25 = 5² or 4² + 3² + 0² + 0².
- Algorithmic approach: Efficient algorithms exist to find the four squares, often using modular arithmetic and descent methods.
- Generalization: The theorem inspired Waring’s Problem, which explores sums of k-th powers for higher exponents.
Comparison at a Glance
The following table compares the Four Square Theorem with related number representation theorems:
| Theorem | Maximum Squares Needed | Proven By | Year | Limitations |
|---|---|---|---|---|
| Four Square Theorem | 4 | Joseph-Louis Lagrange | 1770 | Applies to all natural numbers |
| Three Square Theorem | 3 | Adrien-Marie Legendre | 1798 | Fails for numbers of the form 4ᵏ(8m + 7) |
| Two Square Theorem | 2 | Fermat, proved by Euler | 1749 | Only works for primes ≡ 1 mod 4 |
| Waring’s Problem (k=2) | 4 | Hilbert, 1909 | 1909 | Generalization to all powers |
| Sums of Cubes | 9 | Various contributors | 20th century | Not all numbers need 9; most use fewer |
This comparison highlights the Four Square Theorem’s completeness—unlike the Three Square Theorem, which fails for certain integers, Lagrange’s result holds universally. It also underscores the progression of additive number theory from Fermat to Hilbert, showing how Lagrange’s work laid the foundation for later generalizations.
Why It Matters
The Four Square Theorem is more than a mathematical curiosity—it has lasting implications in number theory, computer science, and cryptography. Its proof introduced techniques still used in modern algebra and inspired further research into quadratic forms and Diophantine equations.
- Foundational proof: Lagrange’s work was among the first to use algebraic identities in number theory systematically.
- Algorithm design: The theorem informs algorithms for integer factorization and optimization problems.
- Cryptography: Sums of squares appear in lattice-based cryptography, a post-quantum encryption candidate.
- Educational value: It is frequently taught in undergraduate number theory courses due to its accessibility and depth.
- Computational testing: The theorem allows verification of large integers using modular reduction techniques.
- Historical impact: It helped unify work by Euler, Fermat, and Diophantus into a coherent mathematical framework.
By proving that four squares suffice for any number, Lagrange provided a complete solution to an ancient problem. The theorem remains a cornerstone of additive number theory and continues to influence both theoretical and applied mathematics.
More What Is in Science
- What Is Photosynthesis
- How can we explain the Penrose Terrel effect when the observer moves
- What is corporatism
- What Is ELI5 Revolving doors
- What Is ELI5 does ego death happen specifically after using psychedelics
- What is the actual color of lava/magma
- What Is ELI5 photovoltaic cells
- What Is ELI5 why is it called a pet peeve
- What is kx in physics
- What Is ELI5 Party Speaker, PA, HiFi, Karaoke System, FRFR
Also in Science
- Why does Pixar animation look so smooth at 24 fps but a video game feel choppy at 30 fps
- Why is Huntington’s Disease expressed usually in a person’s 30s and 40s
- Why is it good for the US for global oil deals to be made in US dollars
- Why do atoms release energy when forming a chemical bond
- How does photosynthesis actually work?
- Why does inhaling helium makes your voice high and squeay
- Why do some materials become stronger under repeated stress instead of weaker
- Difference between real and virtual image (optics)
More "What Is" Questions
Trending on WhatAnswers
Browse by Topic
Browse by Question Type
Sources
- WikipediaCC-BY-SA-4.0
Missing an answer?
Suggest a question and we'll generate an answer for it.