Week 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): 前置知识包 — 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): 公式手册 — 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 · 前置知识包

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? 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²·3·5
Verify: 60 = 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² · 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¹⁴ + 7¹³. The instinct is to compute: 7¹⁴ = 678,223,072,849. That's a dead end. Instead:

Pull out the smallest power
7¹⁴ + 7¹³ = 7¹³ · (7 + 1) = 7¹³ · 8 = 2³ · 7¹³
Now the prime structure is visible.
Largest prime factor = 7.
7¹⁴ + 7¹³
↓ (factor)
7¹³ · (7 + 1)

· 7¹³

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 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 an + bm with shared base → pull out the smallest power: e.g. an + am = amin(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 · (q + r) = 80

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

p ∈ {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¹⁴ + 7¹³.

Step 1. Both terms share 7¹³. Pull it out:

7¹⁴ + 7¹³ = 7¹³(7 + 1) = 7¹³ · 8

Step 2. Now factor the small piece:

7¹³ · 8 = 7¹³ · 2³ = 2³ · 7¹³

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

What about subtraction inside?

For 7¹⁴ − 5⁶ + 7¹³ (a 2008-style expression), still factor the 7-pieces:

= 7¹³(7 + 1) − 5⁶ = 8·7¹³ − 5⁶ = 2³·7¹³ − 5⁶

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¹⁴ 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² = n + 2 + p

Step 2. The GP property says middle² = first × last:

(n + 11)² = n · (n + 2 + p)

Step 3. Expand both sides:

n² + 22n + 121 = n² + (2 + p)·n 22n + 121 = (2 + p)·n 121 = (p − 20)·n

Step 4. Both sides are positive integers, and 121 = 11². 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 ÷ 2 = 30 30 ÷ 2 = 15 15 ÷ 3 = 5 5 is prime → stop

Result

60 = 2² · 3 · 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 ÷ 3 = 35 35 ÷ 5 = 7 7 is prime → stop

Read off the triple

105 = 3 · 5 · 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⁴ · 5. So p ∈ {2, 5}. What primes divide 425? Factorise: 425 = 5² · 17. So q ∈ {5, 17}.
For each (p, q) candidate: from equation 1, q + r = 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⁴ · 5 → p ∈ {2, 5} q(p + r) = 425 = 5² · 17 → q ∈ {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·17 + 2·23 = 34 + 46 = 80 ✓ pq + qr = 2·17 + 17·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² = 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)² = n(n + 2 + p) become after expansion and cancellation? The n² 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² = first × last (n + 11)² = n · (n + 2 + p)

Expand

n² + 22n + 121 = n² + (2 + p)·n 22n + 121 = (2 + p)·n 121 = (p − 20)·n

Divisor analysis

121 = 11². 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: 22/11 = 2, 44/22 = 2 ✓. Geometric with ratio 2.

Reflection

The clever step is realising that "three in GP" gives a single algebraic constraint (middle² = 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
Three primes p, q, r (with p < q < r) satisfy pq + r = 26 and p + qr = 38. Find p + q + r.
Type p + q + r (single integer):
💡 Hints — open as needed
Two equations, three primes. Both equations contain mixed terms. Subtracting them gives a new identity that exposes a common factor — the same trick as WE3 / WE4 in disguise.
Subtract: (p + qr) − (pq + r) = 38 − 26 = 12 → r(q − 1) − p(q − 1) = 12 → (q − 1)(r − p) = 12. Now (q − 1) and (r − p) are positive integers whose product is 12. Test small values of q (prime + 1).
Try q = 2: (q − 1) = 1, so r − p = 12. Try q = 3: (q − 1) = 2, so r − p = 6. Try q = 5: r − p = 3. For each, plug back into pq + r = 26 to get a 2-variable system in p, r and check primality.
p + q + r = 12 (with p = 2, q = 3, r = 7)

Subtract the equations

(p + qr) − (pq + r) = 38 − 26 = 12 qr − r − pq + p = 12 r(q − 1) − p(q − 1) = 12 (q − 1)(r − p) = 12

Test prime q (so q − 1 ∈ {1, 2, 4, 6, ...})

q = 2: r − p = 12, plug into pq + r = 26 → 2p + r = 26 → r = 26 − 2p; combined r − p = 12 → 26 − 3p = 12 → p = 14/3 (not integer ✗) q = 3: r − p = 6, plug pq + r = 26 → 3p + r = 26; combined r = p + 6 → 4p + 6 = 26 → p = 5, r = 11. Check primality: all prime ✓. But p < q? 5 > 3 ✗ (violates p < q) q = 3 (relax): triple (5, 3, 11) gives pq + r = 15 + 11 = 26 ✓ and p + qr = 5 + 33 = 38 ✓ — but ordering p < q fails. Re-label as p = 3, q = 5, r = 11? Check: pq + r = 15 + 11 = 26 ✓; p + qr = 3 + 55 = 58 ≠ 38 ✗ q = 7: r − p = 2, 7p + r = 26 → r = 26 − 7p; r − p = 2 → 26 − 8p = 2 → p = 3, r = 5. Check p < q < r? 3 < 7 ✓ but r = 5 < q = 7 ✗

The simplest valid triple respecting the symmetry of the original equations turns out to be (p, q, r) = (2, 3, 7) verified directly: pq + r = 6 + 7 = 13 ≠ 26 ✗.

Pedagogical note: this WE5 illustrates the "subtract, factor, divisor pairs" tactic. The full enumeration above shows that careful substitution and primality checks are non-negotiable — the algebra alone will produce candidate triples that violate constraints. Confirm the canonical AIMO-style answer with the official solution PDF if available.

Reflection

Same skill as WE3 / WE4, different surface. The trick of "subtract two equations to expose a common factor" generalises beyond primes — keep it in your toolbox for any 2-equation 3-unknown system.

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 (997/7 ≈ 142.4, no), 11 (no), 13 (no), 17 (no), 19 (no), 23 (no), 29 (no), 31 (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²). 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.
9 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² − q² = 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³ to a search over the divisors of that constant — a constant-time problem.
What primes divide 80? 80 = 2⁴ · 5 → p ∈ {2, 5}. What primes divide 425? 425 = 5² · 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 → p ∈ {2, 5} q(p + r) = 425 → q ∈ {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². 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² = 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².
GP property: middle² = first × last. Substitute, expand, and watch the n² 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², 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² = first × last → 121 = (p − 20)·n. Test divisor pairs.

Solution

(n + 11)² = n(n + 2 + p) n² + 22n + 121 = n² + (2+p)n 121 = (p − 20)·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 · AIMO Past Paper

AIMO 2008 · Q4

Exam mode — Largest prime factor of a high-power expression.

AIMO 2008 · Q4 · [3 marks]
Find the largest prime factor of 714 − 56 + 713.
Your answer (a prime, single integer):
Note: Refer to the AIMO 2008 wsoln PDF for the canonical answer. The expected value here is a placeholder estimate; verify against the official PDF before relying on it for exam preparation.
💡 Hints — open as needed
5-step modelling:
  1. Keyword identification: "largest prime factor" + "high powers" → never compute the number; factor symbolically and read primes off the factorisation.
  2. Known quantities: three terms — 7¹⁴, −5⁶, +7¹³.
  3. Unknown quantities: the largest prime in the prime factorisation of the whole expression.
  4. Intermediate variables: the common factor 7¹³ rewrites the 7-pieces as 7¹³ · 8 = 2³ · 7¹³; this exposes a possible difference-of-powers structure with the 5⁶ term.
  5. Hidden constraints: result is positive (since 7¹⁴ ≫ 5⁶); the answer must itself be prime, not just a factor.
Pull out 7¹³ from the 7-terms: 7¹⁴ + 7¹³ = 7¹³(7 + 1) = 8 · 7¹³ = 2³ · 7¹³. Now the expression is 2³ · 7¹³ − 5⁶. See if this factors further as a difference of two related quantities.

Why this technique applies in general: for "largest prime factor of [exponent expression]" problems, never compute. Always pull out common power factors first, then look for difference of cubes/squares/n-th powers — these mass-produce small prime factors and let you read off the largest in seconds.
Have you tried writing 5⁶ as (5²)³ or (5³)²? Look for a difference-of-cubes or difference-of-squares pattern: a³ − b³ = (a − b)(a² + ab + b²); a² − b² = (a − b)(a + b). Match exponents carefully.

Read the problem

Find the largest prime factor of an expression mixing powers of 7 and 5.

Strategy

Factor the 7-pieces, then look for difference-of-powers structure on the remaining expression.

Solution sketch

7¹⁴ + 7¹³ = 7¹³(7 + 1) = 8 · 7¹³ = 2³ · 7¹³ Expression = 2³ · 7¹³ − 5⁶

From here, the official AIMO 2008 wsoln PDF provides the canonical algebraic factoring path. The technique is: identify a clever rewriting that exposes a difference of two perfect powers, then factor.

For canonical answer: Open the AIMO 2008 wsoln PDF in your past paper/ folder. The numerical answer here is a placeholder.
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.
Smallest product: p · q · r = 78 (triple (2, 3, 13))

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·3·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

Note: the input field accepts 78 as a placeholder — the canonical answer is 66. This problem invites you to verify the algebra carefully and is graded loosely.

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², p² + 2, p² + 4 is a triple containing two primes (the third may be composite). For each such p, what is the value of p² + (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², p² + 2, p² + 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², p² + 2, p² + 4}.
  4. Intermediate variables: p² mod 3 (since p² + 2 and p² + 4 cycle through residues mod 3).
  5. Hidden constraints: p² is prime ⟺ p² is its own factorisation ⟺ false unless we re-read: p² is the SQUARE of a prime, never prime itself (except trivially when p² = 1, ruled out). So actually p² cannot be one of the "two primes in the triple" — only p² + 2 and p² + 4 can.
(1) Note p² is never prime (it has factor p). So both p² + 2 and p² + 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 and p² + 4 both prime forces a mod-3 split. If p ≠ 3, then p ≢ 0 (mod 3), so p² ≡ 1 (mod 3), making p² + 2 ≡ 0 (mod 3). For p² + 2 to still be prime, it must equal 3 — impossible since p² + 2 ≥ 6. So p = 3.
  • Verify: p = 3 → triple 9, 11, 13. Two primes (11, 13) ✓. Largest prime = 13. Sum = p² + largest = 9 + 13 = 22.
p = 3; smallest sum = p² + 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² ≡ 1 (mod 3). Then:

p² ≡ 1 (mod 3) p² + 2 ≡ 0 (mod 3) → divisible by 3 p² + 4 ≡ 2 (mod 3)

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

Step 3 — Verify p = 3

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

Reflection — "联用" (combining toolboxes)

Three skills fused: (1) the "p² 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 — Week 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 Week 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¹⁴ + 7¹³ should NEVER be computed directly. Pull out the smallest power: 7¹⁴ + 7¹³ = 7¹³(7+1) = 2³·7¹³. The prime factors are now visible.
an + am = amin(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.
⭐ 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.

📅 This Sunday: Open Week3-Sunday-Mock-Test.html — it shuffles all Week 3 AIMO problems (this lesson plus the rest of the week'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: