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 2013 Q4
Two full past-paper problems, plus a factorisation extension from AIMO 2008 Q4 and separately labelled practice.
AoPS Reference
Optional background: Introduction to Number Theory by Mathew Crawford. Chapters 2 and 4 on primes and prime decomposition. This lesson is self-contained. Publisher's contents.
Why this matters
Prime constraints help reduce an equation to a small set of cases. This lesson practises factorisation, divisibility and complete case checking; it does not certify competition or camp readiness.
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): Five worked examples, progressing from basic factorisation to prime constraints.
  6. Phase 4 (Step 14): Seven practice problems with hints & full solutions.
  7. Phase 5 (Steps 15–17): Two real AIMO past papers plus one exam-style practice, in exam format with progressive hints.
  8. Phase 5.5 (Step 18): Two synthesis problems combining several techniques.
  9. Step 19: Lesson quiz (3 problems, auto-graded).
  10. Step 20: Cheat sheet + ⭐ self-assessment.
Pedagogical note: When a variable is prime, factorisation and divisibility can restrict its possible values. First derive a bound or a finite list of divisors; then test every remaining case. Trying a few small primes alone does not prove completeness. Phase 0 reviews the small primes used in this lesson.
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

Highlighted 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)
For an integer N ≥ 2, test every prime up to √N. If none divides N, then N is prime. The condition N ≥ 2 is essential: 1 is not 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 highlighted, composites crossed out

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

Highlighted cells are prime; crossed-out grey cells are composite. The number 1 is neither. The nine primes below 25 are 2, 3, 5, 7, 11, 13, 17, 19 and 23. This is a useful starting table, not a limit on the primes a problem may require.

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

60 2 30 2 15 3 5 60 = 22 · 3 · 5 Teal = prime · Gold = composite

Every composite (gold) keeps splitting until only primes (teal) 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

Multiplication of the prime values: 2 × 7 = 14. These boxes label numbers; their areas are not a scale model.

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: these product equations reduce to a finite factor-pair check. Prime constraints alone do not guarantee a small or finite solution set.

🔑 Tactic — Prove a finite candidate list: Factor the equation and look for divisibility, parity or an upper bound. Testing small primes can suggest a solution, but it does not prove that larger solutions are impossible.
Parity check: An even product of primes must contain 2. Do not apply this rule to a sum: 3 + 5 = 8 is even although neither prime is 2. For a sum, count the odd terms and check its parity separately.
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. Large powers often become manageable after factorisation or modular reduction. Check for structure before expanding.
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 integer greater than 2 is a sum of two primes. This remains unproved and is not used as a theorem here. Twin primes are prime pairs (p, p+2).

Tactics (use in this order)

  1. "p, q, r are all primes" → constrain the candidates: use divisibility or a proved bound, then test every remaining candidate. There is no general cutoff at 50.
  2. See pq + pr → factor as p(q + r): then read off divisibility (p divides the constant).
  3. For the same positive integer base and non-negative integer exponents, factor out the smaller power: \(a^n+a^m=a^{\min(n,m)}(a^{|n-m|}+1)\).
  4. An even product of primes contains 2. An even sum of an odd number of primes also contains 2. An even sum of two primes need not: 3 + 5 = 8.
  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. They are useful starting points; justify any bound or case split you use.
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.

The listed pairs are unordered; each may also be reversed to give an ordered triple. 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}\) − 56 + \(7^{13}\) (AIMO 2008 Q4), still factor the 7-pieces:

\(= 7^{13}(7 + 1) - 56 = 8\cdot 7^{13} - 56 = 56(7^{12} - 1)\)

Now the bracket \(7^{12} - 1\) is a difference of squares and keeps splitting: \((7^{6} - 1)(7^{6} + 1)\), then \((7^{3} - 1)(7^{3} + 1)\) = 342 · 344 and \((7^{2} + 1)(7^{4} - 7^{2} + 1)\) = 50 · 2353 = 50 · 13 · 181 — small primes fall out at every step (the official 2008 Q4 answer is 181).

🔑 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 \(\text{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. The remaining quotient is prime. Which three prime factors have you obtained?
\(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. If N is the product of exactly three distinct primes, each occurring once, then p · q · r = N with p < q < r forces those three values. Merely knowing that N has three distinct prime divisors is not enough; their exponents matter.

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: \(\text{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: \(\text{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 (\(\text{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.
At least one prime is 2, because three odd primes have an odd sum. Two 2s would leave 18, which is composite, and three 2s sum to 6. Hence exactly one prime is 2. The other two sum to 20. Testing primes at most 10 gives only the unordered pairs \(\{3,17\}\) and \(\{7,13\}\): 5 would require 15, and 7 pairs with 13. Each pair contains two distinct odd primes. Choose the position of 2 in 3 ways and order the remaining primes in 2 ways. Thus there are \(2\cdot3\cdot2=\mathbf{12}\) ordered triples, with no overlap between the two pairs.
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 be positive primes and must satisfy both equations. Distinctness is not stated and must not be assumed; equal candidates are tested and rejected by the equations.
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 reduces the search to prime divisors of known integers. The number of cases depends on those integers; it is not a constant-time rule.
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 ✓.

Use r = 80/p − q from the first equation for every case. (2,5) gives r=35, not prime. (5,5) gives r=11, but q(p+r)=5·16=80 ≠ 425. (5,17) gives r=−1, not a positive prime. Thus only (2,17,23) survives.

\(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" → \(\text{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: \(\text{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). In this problem the resulting equation is an integer product equal to 121, so divisor enumeration is complete. Other problems may require different arguments.
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 \(\text{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\text{ is prime }\to\text{ 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) Check what parity permits. (2) Use the growth of \(pqr-p-q-r\) to exclude all-odd triples. (3) Set \(p=2\), factor and enumerate candidates. (4) Check primality and the strict ordering.
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 (\text{multiply by }2)\) \((2q - 1)(2r - 1) = 105 (\text{Simon's trick}:\text{ 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)\Rightarrow q=3,\ r=11\): both prime and \(2\lt3\lt11\). (7, 15) → q = 4 (not prime ✗)

Verify the surviving triple: \(2\cdot3\cdot11=66\) and \(2+3+11+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)?

Let \(F(p,q,r)=pqr-p-q-r\). Increasing \(p\) by a positive amount \(d\) increases \(F\) by \(d(qr-1)\gt0\); the same argument applies to \(q\) and \(r\). For distinct odd primes in increasing order, \(p\ge3,\ q\ge5,\ r\ge7\). Therefore \(F(p,q,r)\ge F(3,5,7)=105-15=90\gt50\). No all-odd triple can satisfy the equation.

Final answer

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

Reflection

Parity permits both the all-odd case and a case containing 2; it does not force \(p=2\). The increasing-product bound excludes the all-odd case. Simon's Favourite Factoring Trick then turns the remaining equation into a complete finite factor-pair check.

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: A prime \(p\) satisfies \(p\ge2\), so \(p^2=p\cdot p\) is composite. Consequently, the two required primes must be \(p^2+2\) and \(p^2+4\).
(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 · Lesson Quiz

📝 Lesson Quiz

Three problems. No hints. 8 marks total.

📝 Part 1 · Lesson Quiz — 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 · [Revision summary]

Summary — Unit 3 Part 1 · Prime Equations

Use this summary for revision. Return to it through the lesson step menu before reattempting the exercises; it is not an automatic assessment of mastery.

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 — justify the candidate list
Primality alone does not bound a variable. Derive a finite divisor list or an upper bound from the equation, then check every candidate. Small-prime trials are exploration, not a proof of completeness.
③ 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
④ Parity: distinguish products from sums
An even product of primes contains 2. A sum of an odd number of odd primes is odd, so an even sum of three primes contains 2. This does not apply to a sum of two primes: 3 + 5 = 8 is even.
⑤ 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 can use divisibility or a proved bound to produce a complete candidate list, rather than stopping after small-prime trials.
③ 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 2 AIMO past papers in this Part (2002 Q3, 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: re-solve AIMO 2013 Q4 and 2002 Q3 with pencil and paper. Aim for under 5 minutes each. The brain consolidates better when you re-derive on paper.

📅 Unit tests: Take Past-Paper-Test.html first for verified AIMO questions, then Mock-Test.html for the 10-question unit test reusing verified past-paper questions. Answers and review unlock only after submission on each page.
💡 Stuck? Open this for guiding questions (no spoilers)

Ask yourself, in order: