Unit 3 · Part 1 — Prime Equations & Prime Structure 0%
STEP 1 OF 20 · Lesson Opening

Today: Prime Equations & Prime Structure

Equations whose variables must be prime — small search space, big payoff.

📌 What you will learn today

Topic
Working with equations where the variables are prime numbers, or where the structure forces consideration of prime factorisation.
Category
Number Theory (NT) — sub-topic Primes.
Solves these AIMO problems
2002 Q3 2008 Q4 2013 Q4
Three past-paper Q3–Q4 problems — all solvable with prime-equation tactics.
AoPS Reference
Introduction to Number Theory by Mathew Crawford, Chapter 2 (Primes) and Chapter 5 (Special Numbers). Background reading recommended; AIMO-style "primes in equations" problems require the additional tactical practice you'll get here.
Why this matters
Q3–Q5 NT problems often involve primes. Mastering the tactics here is essential for stepping into Q6 territory and crossing the camp threshold.
Time required
About 50–65 minutes for the full lesson, plus 30 minutes practising past papers afterwards.

How this lesson is structured

  1. Phase 0 (Step 2): Prerequisites — prime vs composite, the table of primes under 25, trial division, factor tree, the special role of 2.
  2. Phase 1 (Steps 3–5): Visual intuition — primes as atoms, equations with primes, largest prime factor of complicated expressions.
  3. Phase 1.5 (Step 6): Formula handbook — the small set of facts & tactics you'll re-use.
  4. Phase 2 (Steps 7–9): Three derivations — concrete prime equation, factoring expressions, GP construction.
  5. Phase 3 (Steps 10–13): Four worked examples in strict gradient ⭐ → ⭐⭐⭐⭐.
  6. Phase 4 (Step 14): Three practice problems with hints & full solutions.
  7. Phase 5 (Steps 15–17): Three real AIMO past papers in exam format with progressive hints.
  8. Phase 5.5 (Step 18): Synthesis problem combining several techniques.
  9. Step 19: Mock test (3 problems, auto-graded).
  10. Step 20: Cheat sheet + ⭐ self-assessment.
Pedagogical note: When a variable in an equation is constrained to be prime, the search space collapses dramatically. The tactic is almost always: factor what you canread off divisibilitytry small primes. Skip nothing in Phase 0 — the prime table under 25 should become muscle memory.
STEP 2 OF 20 · Phase 0 · Prerequisites

Phase 0 — Prerequisite Knowledge Pack

Five foundations. Walk through each and check the verification at the end.

0.1 — Prime vs composite
A prime has exactly two positive factors: 1 and itself. A composite has three or more. The number 1 is neither.
  • 7 has factors {1, 7} — prime ✓
  • 4 has factors {1, 2, 4} — composite ✗ (not prime)
Verify: Is 7 prime? Yes. Is 4 prime? No, 4 = 2·2.
0.2 — Primes under 25 (memorise!)
2, 3, 5, 7, 11, 13, 17, 19, 23 — that's nine primes.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25

Sage-green cells are primes. Memorise the pattern.

Verify: Recite from memory — 2, 3, 5, 7, 11, 13, 17, 19, 23.
0.3 — Trial division (the primality test)
To test whether N is prime, divide N by every prime up to √N. If none divides cleanly, N is prime.
Test 91: try 2 (no, odd), 3 (9+1=10, no), 5 (no), 7? \(\frac{91}{7}\) = 13 ✓ So 91 = 7·13 — composite.
Verify: Is 91 prime? No, 91 = 7·13.
0.4 — Factor tree (unique prime factorisation)
Every integer > 1 factors uniquely into primes (Fundamental Theorem of Arithmetic).
60
↙ ↘
2 · 30
↙ ↘
2 · 15
↙ ↘
3 · 5

60 = \(2^{2}\)·3·5
Verify: 60 = \(2^{2}\) · 3 · 5.
0.5 — 2 is the only even prime
Every other prime is odd. Consequence (used constantly in AIMO):
  • odd + odd = even, odd + odd + odd = odd
  • If three primes sum to an even number, one of them MUST be 2.
  • If three primes multiply to an even number, one of them MUST be 2.
Verify: p + q + r = 30 (even) with p, q, r prime → at least one of them must be 2.
STEP 3 OF 20 · Phase 1 · Visual

Primes are indivisible atoms

A prime cannot be split into smaller integer factors (other than 1 and itself).

Try to factor 12 — easy: 12 = 2·2·3. You can split it into smaller pieces.

Try to factor 7 — impossible. The only "factorisation" is 1·7. 7 is an atom in the world of multiplication.

12 = 2 · 2 · 3 (composite, splits into atoms)

7 = 7 (prime, already an atom)

Composites split. Primes don't.

Sieve of Eratosthenes (1–25) — primes pulse, composites fade

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25

Glowing brick cells = primes. Faded grey cells = composites (crossed out by the sieve). Cell "1" is special — neither prime nor composite. The 9 primes ≤ 25 are: 2, 3, 5, 7, 11, 13, 17, 19, 23 — the entire "AIMO prime alphabet" you need.

Factor tree of 60 — every composite ends in a prime base

60 2 30 2 15 3 5 60 = \(2^{2}\) · 3 · 5 Brick = prime · Olive = still composite

Every composite (olive) keeps splitting until only primes (brick) remain. The leaves of the tree, multiplied together, recover the original number — and the multiset of leaves is unique (Fundamental Theorem of Arithmetic).

🔑 The big idea: Every positive integer has a UNIQUE prime factorisation (Fundamental Theorem of Arithmetic). Two integers are equal if and only if their prime decompositions match exponent-by-exponent. This is the foundation for every prime-equation problem.

Why "uniqueness" matters in AIMO

If you see 105 = p · q · r with p, q, r primes, there is essentially one answer — because 105 has a unique prime decomposition: 105 = 3 · 5 · 7. So {p, q, r} = {3, 5, 7} (in some order). This is a search-space-of-one problem.

STEP 4 OF 20 · Phase 1 · Visual

Equations with primes — tiny search spaces

When variables must be prime, you don't need calculus — you need the prime table.

Consider p · q = 14 with p, q prime. What can (p, q) be?

The factor pairs of 14 are 1·14, 2·7. Only 2·7 uses two primes. So (p, q) is (2, 7) or (7, 2). Done.

2 · 7 = 14

Two prime atoms (areas 2 and 7) combining into a rectangle of area 14.

What about p · q = 12? Factor pairs: 1·12, 2·6, 3·4. None of these is a pair of primes. (2 is prime but 6 is not. 3 is prime but 4 is not.) So no solution.

The lesson: equations restricted to primes have very few solutions — sometimes zero.

🔑 Tactic — Try Small Primes: When a problem says "p, q, r are primes" and gives you any equation involving them, the FIRST move is: try p = 2, 3, 5, 7, 11, 13, …. This usually narrows the answer to a handful of candidates within seconds.
Parity heuristic: Among primes, only 2 is even. So if your problem demands an even sum/product of primes, AT LEAST ONE prime is 2. This often forces the value of the smallest prime immediately.
STEP 5 OF 20 · Phase 1 · Visual

Largest prime factor of a complicated expression

When you see ugly powers, FACTOR FIRST. Don't compute.

Look at \(7^{14}\) + \(7^{13}\). The instinct is to compute: \(7^{14}\) = 678,223,072,849. That's a dead end. Instead:

Pull out the smallest power
\(7^{14}\) + \(7^{13}\) = \(7^{13}\) · (7 + 1) = \(7^{13}\) · 8 = \(2^{3}\) · \(7^{13}\)
Now the prime structure is visible.
Largest prime factor = 7.
\(7^{14}\) + \(7^{13}\)
↓ (factor)
\(7^{13}\) · (7 + 1)

\(2^{3}\) · \(7^{13}\)

Two prime atoms — 2 and 7. Largest = 7.

The recipe for "largest prime factor of E"

  1. Pull out the smallest power of the dominant base.
  2. Simplify the parenthesised remainder to a small integer or polynomial.
  3. Factor what's inside the parentheses.
  4. Read off the primes.
🔑 The big idea: Factor before computing. AIMO never asks you to compute giant powers — they always factor cleanly. If the arithmetic looks scary, you missed a factoring step.
STEP 6 OF 20 · Phase 1.5 · Formula handbook

Formula Manual — primes & factorisation

The complete cheat-list. Re-read this between problems.

Definitions & structural facts

  1. Prime definition: N is prime ⟺ N > 1 AND its only positive divisors are 1 and N.
  2. Infinitude of primes: there are infinitely many primes (Euclid's classic proof — background fact).
  3. Unique factorisation theorem (FTA): every N > 1 has a unique prime factorisation N = p₁a₁ · p₂a₂ · …
  4. Primes under 25: 2, 3, 5, 7, 11, 13, 17, 19, 23 (nine primes).
  5. Even prime: 2 is the only even prime. Every other prime is odd.
  6. Background: Goldbach conjecture — every even > 2 is a sum of 2 primes. Twin primes — pairs (p, p+2).

Tactics (use in this order)

  1. "p, q, r are all primes" → try small primes: 2, 3, 5, 7, 11, 13, … most AIMO answers use primes ≤ 50.
  2. See pq + pr → factor as p(q + r): then read off divisibility (p divides the constant).
  3. See \(a^{n}\) + \(b^{m}\) with shared base → pull out the smallest power: e.g. \(a^{n}\) + \(a^{m}\) = \(a^{min}\)(\(a^{|n−m|}\) + 1).
  4. Even sum/product of primes → one of them is 2. Use parity ruthlessly.
  5. Three consecutive odd numbers → one is divisible by 3. So among three primes p, p+2, p+4, the only solution is p = 3.
How to use this manual: When stuck on a problem, scan items 7–11 in order. One of them almost always applies.
STEP 7 OF 20 · Phase 2 · Derivation 1 of 3

Derivation 1 — concrete prime equation

Three primes, one equation. Watch how the search collapses.

Problem: If p, q, r are primes with pq + pr = 80, what does that tell us?

Step 1. Factor the left side. Both terms share p:

\(pq + pr = p \cdot (q + r) = 80\)

Step 2. Read the divisibility. Since p · (q + r) = 80, we have p | 80. Now 80 = \(2^{4}\) · 5, so the prime divisors of 80 are 2 and 5.

\(p \in {2, 5}\)

Step 3. Try each candidate.

Case p = 2: q + r = 40. Pairs of primes summing to 40: (3, 37), (11, 29), (17, 23) — three valid prime pairs. Case p = 5: q + r = 16. Pairs of primes summing to 16: (3, 13), (5, 11) — two valid pairs.

Without further constraints, all of these are admissible. The point: from one equation we narrowed the entire search to a handful of triples.

🎯 Pattern (essential!): See pq + pr → factor as p(q + r) → divisibility tells you p in two seconds.
STEP 8 OF 20 · Phase 2 · Derivation 2 of 3

Derivation 2 — factoring expressions to find primes

Same trick, different costume. The expression looks scary; the factoring tames it.

Problem: Find the largest prime factor of \(7^{14}\) + \(7^{13}\).

Step 1. Both terms share \(7^{13}\). Pull it out:

\(7^{14} + 7^{13} = 7^{13}(7 + 1) = 7^{13} \cdot 8\)

Step 2. Now factor the small piece:

\(7^{13} \cdot 8 = 7^{13} \cdot 2^{3} = 2^{3} \cdot 7^{13}\)

Step 3. The primes appearing are 2 and 7. Largest = 7.

What about subtraction inside?

For \(7^{14}\) − \(5^{6}\) + \(7^{13}\) (a 2008-style expression), still factor the 7-pieces:

\(= 7^{13}(7 + 1) - 5^{6} = 8\cdot 7^{13} - 5^{6} = 2^{3}\cdot 7^{13} - 5^{6}\)

Now the expression is the difference of two products of small primes. Recognise: a difference of squares or higher powers might factor further. (We'll explore this fully in the AIMO past paper for 2008 Q4.)

🔑 Always factor before you compute. If your AIMO problem requires multiplying out \(7^{14}\) on paper, you've taken a wrong turn.
STEP 9 OF 20 · Phase 2 · Derivation 3 of 3

Derivation 3 — three integers, modified into a GP

A specific construction that recurs in AIMO 2002 Q3.

Setup: Take three consecutive positive integers n, n+1, n+2. Modify them: leave the first alone, add 10 to the second, and add a prime p to the third. Demand the result is a geometric progression (GP).

Step 1. Write the modified triple:

\(a = n, ar = n + 11, ar^{2} = n + 2 + p\)

Step 2. The GP property says \(middle^{2}\) = first × last:

\((n + 11)^{2} = n \cdot (n + 2 + p)\)

Step 3. Expand both sides:

\(n^{2} + 22n + 121 = n^{2} + (2 + p)\cdot n\) \(22n + 121 = (2 + p)\cdot n\) \(121 = (p - 20)\cdot n\)

Step 4. Both sides are positive integers, and 121 = \(11^{2}\). Factor pairs (n, p − 20):

(1, 121) → p = 141 (not prime ✗) (11, 11) → p = 31 (prime ✓) (121, 1) → p = 21 (not prime ✗)

The unique prime answer: p = 31, with n = 11. Check: 11, 22, 44 — ratio 2. ✓

🎯 Tactic: When you have one equation and two unknowns (here n, p), but one of them must be prime AND the other must be a positive integer dividing a small number — the divisor structure does almost all the work.
STEP 10 OF 20 · Phase 3 · Worked Example 1 ⭐

Worked Example 1 — write 60 as a prime product

Warm-up: a clean factorisation. Type the largest prime factor.

Worked Example 1 ⭐
Write 60 as a product of primes (powers allowed). Then enter the largest prime factor of 60.
Type the largest prime factor (single integer):
💡 Hints — open as needed
60 is a small composite. The Fundamental Theorem of Arithmetic guarantees a unique prime decomposition. Have you tried dividing by the smallest primes in order (2, then 3, then 5)?
Build a factor tree: divide by 2 as many times as possible, then by 3, then by 5, then by 7, … Stop when the quotient is 1. The remaining set of primes (with multiplicities) is your answer.
Largest prime factor = 5

Factor tree

\(60 \div 2 = 30\) \(30 \div 2 = 15\) \(15 \div 3 = 5\) 5 is prime → stop

Result

\(60 = 2^{2} \cdot 3 \cdot 5\)

Three distinct primes: 2, 3, 5. The largest is 5.

Reflection

This is the everyday tool. Every harder prime problem starts here — get fluent at small factor trees and the rest follows.

Tried first?
STEP 11 OF 20 · Phase 3 · Worked Example 2 ⭐⭐

Worked Example 2 — three distinct primes multiplying to 105

Use unique factorisation directly.

Worked Example 2 ⭐⭐
Three primes p < q < r satisfy p · q · r = 105. Find p + q + r.
Type the sum p + q + r (single integer):
💡 Hints — open as needed
105 must factor into exactly three primes (the factorisation is unique). Three distinct primes — does 105 actually have three distinct prime factors?
Build a factor tree of 105. Stop when you reach all-primes. If you get exactly three distinct primes, you have your answer. If not, no solution exists.
Try dividing 105 by 3. What do you get? Then try dividing the result by 5. Then by 7. Are all three quotients prime?
\(p + q + r = 15\)

Factor tree

\(105 \div 3 = 35\) \(35 \div 5 = 7\) 7 is prime → stop

Read off the triple

\(105 = 3 \cdot 5 \cdot 7\) \((p, q, r) = (3, 5, 7)\) \(p + q + r = 3 + 5 + 7 = 15\)

Verify

3 · 5 · 7 = 105 ✓ — all three are distinct primes ✓

Reflection

This is unique factorisation in action. With p · q · r = N (N has exactly three distinct prime factors), the answer is forced.

Tried first?
STEP 12 OF 20 · Phase 3 · Worked Example 3 ⭐⭐⭐

Worked Example 3 — system of two prime equations

A genuine AIMO 2013 Q4 problem, treated as a teaching example.

Worked Example 3 ⭐⭐⭐ · (= AIMO 2013 Q4)
The primes p, q, r satisfy:
pq + pr = 80   and   pq + qr = 425.
Find p + q + r.
Type p + q + r (single integer):
💡 Hints — open as needed
Two equations, three unknowns — sounds underdetermined. But each unknown is constrained to be a prime, and each equation has a beautiful common-factor structure: pq + pr = p(q + r) and pq + qr = q(p + r). What does each factored equation say about divisibility?
Factor each equation. Then read off divisibility: p divides 80, q divides 425. Both p and q are primes. Now you have a tiny finite list of candidates for each. Test the (p, q) combinations and check that r comes out prime.
What primes divide 80? Factorise: 80 = \(2^{4}\) · 5. So p ∈ {2, 5}. What primes divide 425? Factorise: 425 = \(5^{2}\) · 17. So q ∈ {5, 17}.
For each (p, q) candidate: from equation 1, q + r = \(\frac{80}{p}\). Combine with equation 2 to find r, and check r is prime AND consistent.
\(p + q + r = 42\)

Factor each equation

\(p(q + r) = 80 = 2^{4} \cdot 5 \to p \in {2, 5}\) \(q(p + r) = 425 = 5^{2} \cdot 17 \to q \in {5, 17}\)

Test cases

Case p = 2: q + r = 40. Try q = 5: r = 35 (not prime ✗). Try q = 17: r = 23 (prime ✓). Check eq 2: q(p + r) = 17·25 = 425 ✓. Solution: (p, q, r) = (2, 17, 23).

Case p = 5: q + r = 16. Try q = 5: r = 11. Check eq 2: 5·(5+11) = 80 ≠ 425 ✗. Try q = 17: r = −1 (invalid ✗).

Final answer

\((p, q, r) = (2, 17, 23)\) \(p + q + r = 2 + 17 + 23 = 42\)

Verify

\(pq + pr = 2\cdot 17 + 2\cdot 23 = 34 + 46 = 80 ✓\) \(pq + qr = 2\cdot 17 + 17\cdot 23 = 34 + 391 = 425 ✓\)

Reflection

The factoring of each equation collapses the problem from "three unknowns, two equations" into "two finite divisor lists, four cases to test". Always factor first.

Tried first?
STEP 13 OF 20 · Phase 3 · Worked Example 4 ⭐⭐⭐⭐

Worked Example 4 — three integers modified into a GP

A genuine AIMO 2002 Q3 problem, treated as a teaching example.

Worked Example 4 ⭐⭐⭐⭐ · (= AIMO 2002 Q3)
Start with three consecutive positive integers. Leave the first unchanged, add 10 to the second, and add a prime p to the third. The three numbers are now in a geometric progression. Find p.
Type the prime p (single integer):
💡 Hints — open as needed
The setup gives you three triples written in terms of n: original n, n+1, n+2 and modified n, n+11, n+2+p. Both n and p are unknown. The geometric progression property links them.
Translate "the three numbers are in geometric progression" into algebra: \(middle^{2}\) = first × last. Substitute the modified values, expand, and watch the equation collapse into a clean form involving only n and p.
What does \((n + 11)^{2}\) = n(n + 2 + p) become after expansion and cancellation? The \(n^{2}\) terms should cancel, leaving you with a linear-in-n equation.
You should arrive at 121 = (p − 20)·n. Now you have a divisor problem. What are the positive integer factor pairs of 121? Which give p prime?
\(p = 31\)

Set up

Original: \(n, n + 1, n + 2\) Modified: \(n, n + 11, n + 2 + p\) GP property: \(middle^{2}\) = first × last \((n + 11)^{2} = n \cdot (n + 2 + p)\)

Expand

\(n^{2} + 22n + 121 = n^{2} + (2 + p)\cdot n\) \(22n + 121 = (2 + p)\cdot n\) \(121 = (p - 20)\cdot n\)

Divisor analysis

121 = \(11^{2}\). Factor pairs (n, p − 20):

(1, 121) → p = 141 = 3 · 47 (not prime ✗) (11, 11) → p = 31 (prime ✓) (121, 1) → p = 21 = 3 · 7 (not prime ✗)

Final answer

\(p = 31, n = 11\)

Verify

Original integers 11, 12, 13. Modified: 11, 22, 44. Ratio: \(\frac{22}{11}\) = 2, \(\frac{44}{22}\) = 2 ✓. Geometric with ratio 2.

Reflection

The clever step is realising that "three in GP" gives a single algebraic constraint (\(middle^{2}\) = first·last) which, after expansion, reduces to 121 = (p − 20)·n. From there, divisor structure does all the work.

Tried first?

Worked Example 5 — same skill, fresh framing

Reinforce the "factor + read divisibility" tactic on a different surface form.

Worked Example 5 ⭐⭐⭐⭐ · pattern recognition
Find the smallest prime p such that p, p + 4, and p + 6 are all prime.
Type the smallest such prime p (single integer):
💡 Hints — open as needed
Test small primes in order: p = 2, 3, 5, 7, … For each, check whether p + 4 and p + 6 are also prime. Most candidates fail quickly on a small factor.
Use mod 3. Since 4 ≡ 1 and 6 ≡ 0 (mod 3), the residues of p, p+4, p+6 are p, p+1, p (mod 3). If p ≡ 2 (mod 3) then p+4 ≡ 0, so p+4 is composite; and p = 3 gives p+6 = 9 = \(3^{2}\). So only primes p ≡ 1 (mod 3) can work — test p = 7 first.
Test each small prime:
p = 2: p+4 = 6 = 2·3 ✗
p = 3: p+6 = 9 = \(3^{2}\) ✗
p = 5: p+4 = 9 = \(3^{2}\) ✗
p = 7: p+4 = 11 ✓, p+6 = 13 ✓ — all three prime!
Smallest such prime: p = 7 (giving 7, 11, 13 — all prime)

Check small primes in order

\(p = 2: p+4 = 6 = 2\cdot 3 ✗\) \(p = 3: p+6 = 9 = 3^{2} ✗\) \(p = 5: p+4 = 9 = 3^{2} ✗\) p = 7: p+4 = 11 (prime ✓), p+6 = 13 (prime ✓) ✓

Why p = 7 is the first that works — mod 3

Since 4 ≡ 1 and 6 ≡ 0 (mod 3), the three numbers have residues p, p+1, p (mod 3). If p ≡ 2 (mod 3) then p+4 ≡ 0, so p+4 is divisible by 3 and composite (it is ≥ 6). If p = 3 then p+6 = 9 = \(3^{2}\). So we need p ≡ 1 (mod 3); the smallest such prime is p = 7, and 7, 11, 13 are all prime.

Reflection

This pairs "test small primes" with a mod-3 structural filter that explains why most candidates fail. Compare with Practice 1 (p, p+2, p+4): a different offset changes which residue class is forced to be a multiple of 3.

Tried first?
STEP 14 OF 20 · Phase 4 · Practice

Phase 4 — Practice Problems

Three problems with progressive hints. Try first; reveal hints/solutions only as needed.

Practice 1 · easy

Q: Find all primes p such that p, p + 2, p + 4 are all prime.

Among any three integers in arithmetic progression with common difference 2 (so spaced by 2), what can you say about divisibility by 3?
Only p = 3 works (giving the triple 3, 5, 7).
Among the three numbers p, p+2, p+4 (consecutive odd-spaced integers), exactly one is divisible by 3 — because they cover all three residues mod 3. For all three to be prime, the one divisible by 3 must EQUAL 3 itself. So the triple is (3, 5, 7), giving p = 3. (You can verify: any other p yields one composite divisible by 3.)
Practice 2 · medium

Q: What is the largest prime less than 1000?

Start at 999 and check downwards using trial division (test each prime up to √n ≈ 32).
997.
999 = 3 · 333 (composite). 998 = 2 · 499 (composite). 997: test divisibility by 2 (no, odd), 3 (9+9+7=25, no), 5 (no), 7 (\(\frac{997}{7}\) ≈ 142.4, no), 11 (no), 13 (no), 17 (no), 19 (no), 23 (no), 29 (no), 31 (\(\frac{997}{31}\) ≈ 32.2, no). All primes ≤ √997 ≈ 31.6 fail to divide. So 997 is prime. Answer: 997.
Practice 3 · medium

Q: Find the number of primes strictly between 100 and 200.

Use the sieve method or list known primes in this range. Only need to check trial division by 2, 3, 5, 7, 11, 13 (since √200 ≈ 14.1).
21 primes.
Primes in (100, 200): 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199. Count = 21.
Practice 4 · medium · speed

Q: Two primes p and q satisfy p + q = 36. How many unordered pairs {p, q} are there?

36 is even and the only even prime is 2. If p = 2 then q = 34 (not prime). So both p, q must be odd. Sweep odd primes from 3 to 17 and read off pairs.
4 pairs.
Both must be odd primes. Pairs (p, q) with p ≤ q and p + q = 36: (5, 31) ✓, (7, 29) ✓, (13, 23) ✓, (17, 19) ✓. (3, 33) fails (33 = 3·11), (11, 25) fails (25 = \(5^{2}\)). Count = 4.
Practice 5 · medium · pattern recognition

Q: Three primes p, q, r (not necessarily distinct) satisfy p + q + r = 22. Find the number of ordered triples (p, q, r).

22 is even. Sum of three odd numbers is odd. So at least one of p, q, r equals 2. Substitute and solve a 2-variable case.
12 ordered triples.
Exactly one of the three must be 2 (sum constraint). The other two odd primes sum to 20: pairs (3, 17), (7, 13), (13, 7), (17, 3) — but we want unordered pairs first: {3, 17}, {7, 13}. For each unordered pair {a, b} with a ≠ b, the position of the 2 has 3 choices, and (a, b) order has 2 → 6 triples per pair × 2 unordered pairs ÷ 2 = wait, careful: for the ordered triple, the position of the 2 is 3 choices, and the other two are an ordered pair (a, b) with 2 arrangements → 3 × 2 = 6 triples per unordered pair. With 2 unordered pairs we'd get 12. But we miss double-counting only if a = b, which doesn't happen here. Re-check by direct listing of ordered triples with primes summing to 22 and exactly one equal to 2: (2, 3, 17), (2, 17, 3), (2, 7, 13), (2, 13, 7), (3, 2, 17), (17, 2, 3), (7, 2, 13), (13, 2, 7), (3, 17, 2), (17, 3, 2), (7, 13, 2), (13, 7, 2) → 12 triples. Note: if "ordered" includes the (5, 7, 10) family etc., these all fail primality. Answer (corrected): 12.
Practice 6 · hard · structure recognition

Q: Find all primes p such that 2p + 1 is also prime, and 4p + 1 is also prime, with p ≤ 50.

Test mod 3. For p ≠ 3, p is ≡ 1 or 2 (mod 3); compute 2p+1 and 4p+1 mod 3 in each case.
Only p = 3 works (3, 7, 13 all prime).
If p ≡ 1 (mod 3), then 2p + 1 ≡ 3 ≡ 0 (mod 3), so divisible by 3 → fails (unless 2p+1 = 3 → p = 1, not prime). If p ≡ 2 (mod 3), then 4p + 1 ≡ 8 + 1 ≡ 9 ≡ 0 (mod 3) → fails. So p ≡ 0 (mod 3), meaning p = 3. Verify: 2·3+1 = 7 ✓ prime, 4·3+1 = 13 ✓ prime. p = 3 only.
Practice 7 · hard · combined

Q: Two primes p and q satisfy \(p^{2}\) − \(q^{2}\) = 24. Find p + q.

Difference of squares: (p − q)(p + q) = 24. Both factors must be positive integers of the same parity, and (p + q) ≥ (p − q).
p + q = 12 (with p = 7, q = 5).
(p − q)(p + q) = 24. Same parity required: (2, 12) → p = 7, q = 5 — both prime ✓. (4, 6) → p = 5, q = 1 — q not prime ✗. (6, 4) → p − q > p + q absurd. (1, 24) and (3, 8) different parity ✗. p + q = 12.
STEP 15 OF 20 · Phase 5 · AIMO Past Paper

AIMO 2013 · Q4

Exam mode — System of two prime equations. Solve on paper first; hints are on the right.

AIMO 2013 · Q4 · [3 marks]
The prime numbers p, q, r satisfy:
pq + pr = 80   and   pq + qr = 425.
Find the value of p + q + r.
Your answer (a positive integer):
💡 Hints — open as needed
5-step modelling:
  1. Keyword identification: "primes" + "two linear equations in pairwise products" → factor-and-divide tactic.
  2. Known quantities: two constants 80 and 425; the constraint that p, q, r are all prime.
  3. Unknown quantities: three primes p, q, r — and the sum p + q + r.
  4. Intermediate variables: the factored forms p(q+r) and q(p+r) act as a bridge: each turns a sum of products into a single divisibility statement.
  5. Hidden constraints: p, q, r must all be positive primes; p ≠ q ≠ r is implied by the structure (otherwise both equations collapse).
Factor: p(q + r) = 80 and q(p + r) = 425. Read off: p divides 80 and q divides 425. Both p and q are primes. Get the small candidate lists, then test combinations.

Why this technique applies in general: whenever two unknowns multiply a third (or each other) with the result equal to a known constant, factoring + reading divisibility from each prime side collapses an enumeration over \(R^{3}\) to a search over the divisors of that constant — a constant-time problem.
What primes divide 80? 80 = \(2^{4}\) · 5 → p ∈ {2, 5}. What primes divide 425? 425 = \(5^{2}\) · 17 → q ∈ {5, 17}. Now test the four (p, q) pairs.

Read the problem

Two equations, three prime unknowns p, q, r. Find p + q + r.

Strategy

Factor each equation, read divisibility, list candidates, test.

Solution

\(p(q + r) = 80 \to p \in {2, 5}\) \(q(p + r) = 425 \to q \in {5, 17}\)

Test (p, q) = (2, 17): q + r = 40 → r = 23 (prime). p + r = 25, q(p+r) = 17·25 = 425 ✓.

Other cases fail: (2,5) gives r=35 (not prime); (5,5) gives 5(5+r)=425 → r=80 (not prime); (5,17) gives r=11 but q(p+r)=17·16=272 ≠ 425.

\(p + q + r = 2 + 17 + 23 = 42\)

Verify

\(pq + pr = 34 + 46 = 80 ✓\) \(pq + qr = 34 + 391 = 425 ✓\)
Tried everything?
STEP 16 OF 20 · Phase 5 · AIMO Past Paper

AIMO 2002 · Q3

Exam mode — Three integers modified into a GP. Solve on paper first.

AIMO 2002 · Q3 · [3 marks]
Start with three consecutive positive integers. Leave the first unchanged, add 10 to the second and add a prime to the third. The three numbers are now in a geometric progression — that is, of the form a, ar, \(ar^{2}\). What was the prime number added to the third?
Your answer (the prime, single integer):
💡 Hints — open as needed
5-step modelling:
  1. Keyword identification: "consecutive integers" → set the triple as n, n+1, n+2; "geometric progression" → \(middle^{2}\) = first × last.
  2. Known quantities: the second is increased by 10; the third is increased by an unknown prime p; the result is in GP.
  3. Unknown quantities: the prime p (and the starting integer n).
  4. Intermediate variables: after modification the triple is (n, n+11, n+2+p); the GP equation gives 121 = (p − 20)·n, an integer-divisor relation.
  5. Hidden constraints: n is a positive integer; p is prime; (p − 20) and n are both positive divisors of 121 = \(11^{2}\).
GP property: \(middle^{2}\) = first × last. Substitute, expand, and watch the \(n^{2}\) terms cancel. You'll be left with a linear equation in n with p as a parameter. Then use divisor structure on the constant.

Why this technique applies in general: any "consecutive integer" or "consecutive term" problem becomes manageable once you parametrise by a single variable n and apply the structural relation (GP, AP, sum). The leftover equation is almost always a small Diophantine in n and the unknown — solvable by divisor enumeration.
After expansion you should get 121 = (p − 20)·n. Since 121 = \(11^{2}\), factor pairs are (1, 121), (11, 11), (121, 1). Compute p for each and reject non-primes.

Read the problem

Three consecutive integers, modified by adding 0, 10, p to first/second/third. Result is a GP. Find prime p.

Strategy

Use \(middle^{2}\) = first × last → 121 = (p − 20)·n. Test divisor pairs.

Solution

\((n + 11)^{2} = n(n + 2 + p)\) \(n^{2} + 22n + 121 = n^{2} + (2+p)n\) \(121 = (p - 20)\cdot n\)

Pairs (n, p−20): (1, 121) → p = 141 = 3·47 ✗; (11, 11) → p = 31 ✓; (121, 1) → p = 21 = 3·7 ✗.

\(p = 31, n = 11\)

Verify

Modified triple: 11, 22, 44. Ratio = 2. ✓

Tried everything?
STEP 17 OF 20 · Phase 5 · Largest Prime Factor

Largest Prime Factor

Exam mode — Factorise completely, then read off the largest prime factor.

Largest Prime Factor · [3 marks]
Find the largest prime factor of 2024.
Your answer (a prime, single integer):
💡 Hints — open as needed
5-step modelling:
  1. Keyword identification: "largest prime factor" → build the complete prime factorisation by trial division.
  2. Known quantities: the number 2024.
  3. Unknown quantities: the largest prime that divides 2024.
  4. Intermediate variables: each prime factor found, in increasing order.
  5. Hidden constraints: the answer must be prime; the product of all prime factors (with multiplicity) equals 2024.
Trial division: divide 2024 by the smallest primes in order (2, 3, 5, 7, 11, …) until the quotient is 1. The largest prime you use is the answer.

Why this technique applies in general: for any "largest prime factor" of a not-too-large number, systematic trial division up to √N is the reliable, hand-computable method. Here √2024 ≈ 45, so you only test primes up to 43.
2024 is even → keep dividing by 2 until the quotient is odd. After removing all 2s you reach 253. Which small odd prime divides 253?

Read the problem

Find the largest prime factor of 2024 by complete prime factorisation.

Strategy

Trial division by primes in increasing order until the quotient reaches 1.

Solution

\(2024 \div 2 = 1012\) \(1012 \div 2 = 506\) \(506 \div 2 = 253\) \(253 \div 11 = 23 (23 is prime \to stop)\)

So 2024 = \(2^{3}\) × 11 × 23. The prime factors are 2, 11, 23, and the largest is 23.

Largest prime factor = 23

Verify

\(2^{3} \times 11 \times 23 = 8 \times 253 = 2024 ✓\)
Tried everything?
STEP 18 OF 20 · Phase 5.5 · Synthesis

Synthesis Problem — primes, parity, bounded search

Combines: small-prime testing + parity argument + bounded enumeration.

Synthesis · ⭐⭐⭐⭐
Find all prime triples (p, q, r) with p < q < r such that p · q · r = p + q + r + 50.

Enter the value of p · q · r for any solution you find. (If multiple solutions exist, enter the smallest product.)
Type p · q · r (single integer):
💡 Hints — open as needed
Three primes whose product equals their sum plus 50. The product grows much faster than the sum, so r cannot be too large. There must be only finitely many candidate triples.
(1) Use parity to fix p. (2) Use a bound on r. (3) Enumerate candidates for q. (4) Solve for r and check primality.
Parity: if all of p, q, r are odd, then pqr is odd and p+q+r is odd, so pqr − (p+q+r) is even. RHS − LHS shifts by 50 (even). So either all three odd works in principle, OR p = 2. Test p = 2 first since it dramatically simplifies.
With p = 2: 2qr = q + r + 52, so 2qr − q − r = 52. Multiply by 2: 4qr − 2q − 2r = 104. Add 1: (2q − 1)(2r − 1) = 105 = 3 · 5 · 7. Now factor pairs of 105 give you (2q−1, 2r−1). Solve for (q, r) and demand both prime with q < r.
Unique product: p · q · r = 66 (triple (2, 3, 11))

Setup with p = 2

\(2qr = 2 + q + r + 50\) \(2qr - q - r = 52\) \(4qr - 2q - 2r = 104 (multiply by 2)\) \((2q - 1)(2r - 1) = 105 (Simon's trick: add 1)\)

Factor 105

105 = 3 · 5 · 7. Factor pairs (with first ≤ second):

(1, 105) → q = 1 (not prime ✗) (3, 35) → q = 2 (but q > p = 2 required ✗) (5, 21) → q = 3 (prime ✓), r = 11 (prime ✓) — TRIPLE (2, 3, 11)? Check: \(2\cdot 3\cdot 11 = 66; 2+3+11 = 16; 16+50 = 66 ✓\) (7, 15) → q = 4 (not prime ✗)

Wait — let me recheck (5, 21): 2q − 1 = 5 → q = 3; 2r − 1 = 21 → r = 11. Both prime. (2, 3, 11): product = 66, sum = 16, sum + 50 = 66 ✓.

Also check (3, 35): 2q − 1 = 3 → q = 2 (= p, not allowed since p < q). Reject.

So with p = 2, the unique solution is (2, 3, 11), giving product 66.

What about all-odd triples (p ≥ 3)?

If p ≥ 3, then pqr ≥ 3·5·7 = 105 already, and p + q + r ≤ 3 + 5 + 7 = 15 — so pqr − (p+q+r) ≥ 90, much greater than 50. With larger primes, the gap only grows. So no all-odd solution exists.

Final answer

Unique triple: (p, q, r) = (2, 3, 11), product = 66

Reflection

Three techniques fused: (1) parity argument forced p = 2 to test first; (2) Simon's Favourite Factoring Trick (SFFT) turned a 2-variable equation into a divisor problem; (3) bounded enumeration eliminated other cases.

Tried first?

Synthesis Problem 2 — primes meet modular reasoning

Combines: prime constraint + mod-3 case split + bounded enumeration. How to switch toolboxes: open with the prime parity heuristic, but if no even prime appears, switch immediately to mod-3 to force a small case.

Synthesis 2 · ⭐⭐⭐⭐
Find all primes p such that \(p^{2}\), \(p^{2}\) + 2, \(p^{2}\) + 4 is a triple containing two primes (the third may be composite). For each such p, what is the value of \(p^{2}\) + (the largest prime in the triple)? Enter the smallest such sum.
Type the smallest sum (single integer):
💡 Hints — open as needed
5-step modelling:
  1. Keyword identification: "\(p^{2}\), \(p^{2}\) + 2, \(p^{2}\) + 4" → arithmetic progression with common difference 2 → mod-3 fingerprint.
  2. Known quantities: the three values are determined by p alone.
  3. Unknown quantities: primes p; for each, identify the largest prime among {\(p^{2}\), \(p^{2}\) + 2, \(p^{2}\) + 4}.
  4. Intermediate variables: \(p^{2}\) mod 3 (since \(p^{2}\) + 2 and \(p^{2}\) + 4 cycle through residues mod 3).
  5. Hidden constraints: \(p^{2}\) is prime ⟺ \(p^{2}\) is its own factorisation ⟺ false unless we re-read: \(p^{2}\) is the SQUARE of a prime, never prime itself (except trivially when \(p^{2}\) = 1, ruled out). So actually \(p^{2}\) cannot be one of the "two primes in the triple" — only \(p^{2}\) + 2 and \(p^{2}\) + 4 can.
(1) Note \(p^{2}\) is never prime (it has factor p). So both \(p^{2}\) + 2 and \(p^{2}\) + 4 must be prime. (2) Among any AP with common difference 2 spanning three terms, one is divisible by 3. (3) Use this to force p, then verify.

Why this technique applies in general: "three values in AP, all prime" problems collapse on mod 3 every single time. Memorise: any AP of length ≥ 3 with common difference 2 forces one term to be ≡ 0 (mod 3).
Toolbox switch narrative:
  • Toolbox A (parity from WE5/Synth 1): "is one of them even?" — try p = 2: triple is 4, 6, 8 — none of {6, 8} is prime. Reject. Move on.
  • Toolbox B (mod 3, this problem's key): \(p^{2}\) + 2 and \(p^{2}\) + 4 both prime forces a mod-3 split. If p ≠ 3, then p ≢ 0 (mod 3), so \(p^{2}\) ≡ 1 (mod 3), making \(p^{2}\) + 2 ≡ 0 (mod 3). For \(p^{2}\) + 2 to still be prime, it must equal 3 — impossible since \(p^{2}\) + 2 ≥ 6. So p = 3.
  • Verify: p = 3 → triple 9, 11, 13. Two primes (11, 13) ✓. Largest prime = 13. Sum = \(p^{2}\) + largest = 9 + 13 = 22.
p = 3; smallest sum = \(p^{2}\) + 13 = 22

Step 1 — Eliminate the easy case

Try p = 2: triple is (4, 6, 8). None of 6 or 8 is prime. So p = 2 fails the "two primes" requirement. Reject.

Step 2 — Mod-3 argument for p ≠ 3

If p is prime and p ≠ 3, then p ≡ 1 or 2 (mod 3), so \(p^{2}\) ≡ 1 (mod 3). Then:

\(p^{2} \equiv 1 (\mod 3)\) \(p^{2}\) + 2 ≡ 0 (mod 3) → divisible by 3 \(p^{2} + 4 \equiv 2 (\mod 3)\)

So \(p^{2}\) + 2 is divisible by 3. For it to be prime, it would have to equal 3 — impossible since p ≥ 5 ⇒ \(p^{2}\) + 2 ≥ 27 > 3. So no prime p ≠ 3 works.

Step 3 — Verify p = 3

\(p^{2}\) = 9, \(p^{2}\) + 2 = 11 (prime ✓), \(p^{2}\) + 4 = 13 (prime ✓) Two primes among the triple: {11, 13}. Largest = 13. \(p^{2}\) + (largest prime) = 9 + 13 = 22

Reflection — combining toolboxes

Three skills fused: (1) the "\(p^{2}\) is never prime" parity-flavoured fact (Toolbox A); (2) mod-3 case split forcing p = 3 (Toolbox B); (3) bounded verification (Toolbox C). Notice the switching rule: parity rules out p = 2 instantly; mod 3 then handles all p ≠ 3; only p = 3 remains as a candidate to check by direct substitution. Three toolboxes, three lines of work, one answer.

Tried first?
STEP 19 OF 20 · Mock Test

📝 Mock Test

Three problems. No hints. 8 marks total.

📝 Part 1 · Mock Test — 3 problems · Total: 8 marks · No hints

Work each one on paper, type the final answer, then submit all together.

Q1 · 2 marks
Two primes p and q satisfy p + q = 30 with p < q. How many ordered pairs (p, q) are there?
Q2 · 3 marks
Find the largest prime factor of 1001.
Q3 · 3 marks
Three primes p < q < r satisfy p + q + r = 50 and p · q · r is divisible by 7. Find p · q · r.
STEP 20 OF 20 · Summary · [reusable: Previous Review · Chapter Review · PDF]

Summary — Unit 3 Part 1 · Prime Equations

The whole lesson on one screen. This page is reusable — it will reappear at the start of tomorrow's lesson as "Previous Review", and at the end of Unit 3 as "Chapter Review". It can also be exported as a printable PDF.

Key ideas (not just formulas)

① Unique factorisation (FTA)
Every positive integer > 1 has a unique factorisation into primes (up to order). This is the foundation: when an equation says "p, q, r are primes with pqr = N", look at N's prime factorisation directly.
N = p₁a₁ · p₂a₂ · …
② Equations with primes — try small primes
When a variable is constrained to be prime, the search space is tiny. Try p = 2, 3, 5, 7, 11, 13, 17, 19, 23, ... in order. Most AIMO answers use primes ≤ 50.
③ Common factor → divisibility immediately
See pq + pr → factor as p(q + r). See pq + qr → factor as q(p + r). Then read off divisibility: p (or q) must divide the constant on the RHS.
pq + pr = K ⟹ p | K
④ Even sum/product of primes ⟹ one of them = 2
Three odd primes sum to odd. Three odd primes multiply to odd. So if a sum or product of primes is even, at least one of them must be 2 (the only even prime). This often pins down the smallest prime instantly.
⑤ Three odd-spaced primes → one is 3
Among any three integers in arithmetic progression with difference 2 (so p, p+2, p+4), exactly one is divisible by 3. For all three to be prime, that one must BE 3. So p = 3 is the only option.
⑥ Factor before computing high powers
Expressions like \(7^{14}\) + \(7^{13}\) should NEVER be computed directly. Pull out the smallest power: \(7^{14}\) + \(7^{13}\) = \(7^{13}\)(7+1) = \(2^{3}\)·\(7^{13}\). The prime factors are now visible.
\(a^{n}\) + \(a^{m}\) = \(a^{min(n,m)}\)(\(a^{|n−m|}\) + 1)

Common pitfalls

When to use these techniques

If a problem mentions any of:

… then this is a prime-equation problem. Apply the recipe: factor → read divisibility → try small primes → verify.

⭐ Self-assessment

Rate your understanding of each concept: ⭐ familiar / ⭐⭐ can solve / ⭐⭐⭐ can teach.

① I can recognise when a problem demands prime factorisation, and I can build a factor tree fluently.
② I know that equations with primes have small search spaces — I instinctively try small primes (2, 3, 5, 7, …) first.
③ I can factor pq + pr → p(q + r) and use divisibility to constrain p immediately.
④ I know that 2 is the only even prime — and I use parity arguments to force the value of one prime.
⑤ I have walked through the 3 AIMO past papers in this Part (2002 Q3, 2008 Q4, 2013 Q4) and could re-solve them next week.
⭐ \(\frac{0}{15}\) — click stars to record your mastery
🎉 Part 1 complete. Tomorrow we'll do Part 2 — Advanced Powers (sums of powers, exponent matching, the cannonball problem). Same teaching style, new techniques.

Tonight: print AIMO 2013 Q4 and 2002 Q3 from past paper/ and re-solve them with pencil and paper. Aim for under 5 minutes each. The brain consolidates better when you re-derive on paper.

📅 Practice test: Open Mock-Test.html — it shuffles all Unit 3 AIMO problems (this lesson plus the rest of the unit's topics) into a single timed mock, so you practise integration and pacing under exam conditions.
💡 Stuck? Open this for guiding questions (no spoilers)

Ask yourself, in order: