IA idea · Cryptography & number theory
Which numbers are the sum of two squares?
Research question
Which whole numbers can be written as a² + b², what pattern in their prime factors decides it, and how much of that pattern can you prove?
Adapt it: change the place, the data or the comparison until the question is yours.
Free: the A–E checklist an examiner uses, by email ↓
Why it makes a good exploration
A spreadsheet reveals a striking pattern about primes of the form 4k + 1 and 4k + 3. Proving part of it (for example, that no number of the form 4k + 3 is a sum of two squares) is achievable and genuinely yours.
The mathematics you'll need
- Systematic search and tables
- Squares modulo 4 (new: modular arithmetic)
- Proof that 4k + 3 numbers are never sums of two squares
- The product identity (a² + b²)(c² + d²) = (ac − bd)² + (ad + bc)²
- HL: connection with complex numbers and |z|²
Course labels show where a technique sits; using maths from outside your course is fine if you explain it clearly and say it is new to you.
Where the data comes from
No data needed; generate tables in a spreadsheet and compare with OEIS.
- OEIS (On-Line Encyclopedia of Integer Sequences) — Check a sequence you have found and read its known formulas and references.
Cite every source in a footnote where you use it and in your bibliography. Check the licence of any dataset you download.
A possible outline
- List sums of two squares up to 200 and look for patterns.
- Classify primes and make a conjecture.
- Prove the 4k + 3 result.
- Prove the product identity, and with complex numbers.
- State what remains unproved and reflect on it.
Pitfalls that cost marks
- Claiming the full theorem is proved when only part is.
- A table with no conjecture.
- Copying a proof from a book without understanding it.
Showing personal engagement
- Make your own conjectures and record the false ones.
- Count how many ways a number can be written.
- Extend to sums of three squares.
See Criterion C: personal engagement for what examiners look for.
Which course is it for?
| Course | Fit | Maths to lean on |
|---|---|---|
| AA SL | Fits — ambitious at SL | Systematic search and tables; Squares modulo 4 (new: modular arithmetic) |
| AA HL | Good fit | Systematic search and tables; Squares modulo 4 (new: modular arithmetic) |
| AI SL | Not a natural fit | The mathematics is mainly AA or HL (calculus or proof beyond AI SL); an AI SL version would need a data-driven, technology-based approach. |
| AI HL | Not a natural fit | The mathematics is mainly from the AA course; an AI HL version would need modelling with technology, statistics or networks at HL level. |
Level: Ambitious. Suits confident students; expect to learn some mathematics on your own. See how the IA differs between AA and AI, SL and HL.
How this idea reaches the top bands
Personal engagement (C)
Build and break your own small cipher or code, invent examples to test each result, and record the conjectures you made and the ones that turned out to be false.
Reflection (D)
Reflect on what each result guarantees and what it doesn't: which errors a check digit misses, which attacks a cipher survives, and how the answer depends on the size of the numbers. For this idea, start with: claiming the full theorem is proved when only part is — say how it affects your answer.
Use of mathematics (E)
SL: Counting principles, probability or frequency statistics used correctly; any number theory (modular arithmetic, primes) introduced with your own small worked examples and explained, not quoted.
HL: Rigorous proofs (by contradiction or induction) of the number-theory facts you rely on, counting arguments made general, or a statistical attack tested formally.
Criteria A and B (presentation and communication) work the same way for every idea: see the guides to Criterion A and Criterion B.
Taking it further
Count the number of representations of n, or explore which numbers are sums of three squares.
Extending it for HL
This idea already has HL mathematics in it: connection with complex numbers and |z|². Prove the key result in general (why the check digit catches every single-digit error, why the decryption undoes the encryption) rather than checking examples.
See a complete IA, marked
Our annotated exemplar How far can a stack of books lean over the edge of a table? (AA HL) asks a different question, but shows how a complete cryptography exploration is structured and marked, with an examiner's comment on every criterion. Free excerpts and the full marking table are on its page.
Before you start: the checklist an examiner uses
Every check for Criteria A–E in a 4-page PDF, the mistakes that cost the most marks and a self-assessment grid. We'll email it with a short IA tip every few days, timed to your deadline if you give it. Free — no account, no payment.
While you wait for the email: read the free excerpt of a complete, annotated IA (Book-stack overhang (AA HL)) →
Turn this idea into your IA
Similar ideas
- The Collatz conjecture: what can we say about stopping times?AA SLAA HLAI SLAI HLSolid
- How many primes are there below n? Testing the prime number theoremAA SLAA HLAI SLSolid
- Which typing errors does a check digit catch? ISBN-10 versus ISBN-13AA HLAA SLSolid
- Patterns in the last digits of powersAA SLAA HLSolid
All cryptography ideas · AA HL ideas · AA SL ideas · All 239 IA ideas