Number theory · Maths EE idea · Solid

Which numbers are sums of two squares?

A research question to start from

Which positive integers can be written as the sum of two squares, and how does the number of such representations depend on the prime factorisation?

A starting point, not your question: change the case, the comparison or the limit until it is yours. The research-question builder helps you check it.

Why it works as a maths EE

A classical result with an elementary but genuine proof, and a counting question you can test by computation before you prove it.

Mathematics you would need

  • Modular arithmetic and quadratic residues
  • Primes of the form 4k+1 and 4k+3
  • Gaussian integers (optional route)
  • Counting divisors by residue class

Much of this goes beyond the DP course. That is expected in a maths EE, but you must understand and explain everything you use.

One possible line of attack

  1. Tabulate which n up to 200 are sums of two squares and look for the pattern in their prime factors.
  2. Prove that primes of the form 4k+3 cannot be sums of two squares, and that the product of two sums of two squares is one.
  3. Present a proof (or a carefully referenced and explained one) that every prime of the form 4k+1 is a sum of two squares.
  4. Count representations and compare your formula with computed values.

Scope and difficulty

Solid. Well bounded. The full characterisation is achievable; the counting formula is the stretch.

Pitfalls

  • Reproducing a textbook proof without showing understanding of each step.
  • Stopping at the pattern without a proof.

Where to start reading

Search a library catalogue or a university's open lecture notes for: Fermat's two-square theorem; sum of squares function; Gaussian integers. Prefer textbooks, lecture notes and journal articles to a single website, and cite everything you use (how to reference a maths EE).

Make it your EE

Similar ideas

All number theory ideas · the full ideas library