Today: Prime Equations & Prime Structure
Equations whose variables must be prime — small search space, big payoff.
📌 What you will learn today
How this lesson is structured
- Phase 0 (Step 2): Prerequisites — prime vs composite, the table of primes under 25, trial division, factor tree, the special role of 2.
- Phase 1 (Steps 3–5): Visual intuition — primes as atoms, equations with primes, largest prime factor of complicated expressions.
- Phase 1.5 (Step 6): Formula handbook — the small set of facts & tactics you'll re-use.
- Phase 2 (Steps 7–9): Three derivations — concrete prime equation, factoring expressions, GP construction.
- Phase 3 (Steps 10–13): Five worked examples, progressing from basic factorisation to prime constraints.
- Phase 4 (Step 14): Seven practice problems with hints & full solutions.
- Phase 5 (Steps 15–17): Two real AIMO past papers plus one exam-style practice, in exam format with progressive hints.
- Phase 5.5 (Step 18): Two synthesis problems combining several techniques.
- Step 19: Lesson quiz (3 problems, auto-graded).
- Step 20: Cheat sheet + ⭐ self-assessment.
Phase 0 — Prerequisite Knowledge Pack
Five foundations. Walk through each and check the verification at the end.
- 7 has factors {1, 7} — prime ✓
- 4 has factors {1, 2, 4} — composite ✗ (not prime)
Highlighted cells are primes. Memorise the pattern.
↙ ↘
2 · 30
↙ ↘
2 · 15
↙ ↘
3 · 5
60 = \(2^{2}\)·3·5
- 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.
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.
7 = 7 (prime, already an atom)
Composites split. Primes don't.
Sieve of Eratosthenes (1–25) — primes highlighted, composites crossed out
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
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).
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.
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.
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.
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:
↓ (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"
- Pull out the smallest power of the dominant base.
- Simplify the parenthesised remainder to a small integer or polynomial.
- Factor what's inside the parentheses.
- Read off the primes.
Formula Manual — primes & factorisation
The complete cheat-list. Re-read this between problems.
Definitions & structural facts
- Prime definition: N is prime ⟺ N > 1 AND its only positive divisors are 1 and N.
- Infinitude of primes: there are infinitely many primes (Euclid's classic proof — background fact).
- Unique factorisation theorem (FTA): every N > 1 has a unique prime factorisation N = p₁a₁ · p₂a₂ · …
- Primes under 25:
2, 3, 5, 7, 11, 13, 17, 19, 23(nine primes). - Even prime: 2 is the only even prime. Every other prime is odd.
- 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)
- "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.
- See
pq + pr→ factor asp(q + r): then read off divisibility (p divides the constant). - 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)\).
- 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.
- Three consecutive odd numbers → one is divisible by 3. So among three primes p, p+2, p+4, the only solution is p = 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:
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.
Step 3. Try each candidate.
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.
pq + pr → factor as p(q + r) → divisibility tells you p in two seconds.
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:
Step 2. Now factor the small piece:
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:
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).
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:
Step 2. The GP property says \(\text{middle}^{2}\) = first × last:
Step 3. Expand both sides:
Step 4. Both sides are positive integers, and 121 = \(11^{2}\). Factor pairs (n, p − 20):
The unique prime answer: p = 31, with n = 11. Check: 11, 22, 44 — ratio 2. ✓
Worked Example 1 — write 60 as a prime product
Warm-up: a clean factorisation. Type the largest prime factor.
Factor tree
Result
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.
Worked Example 2 — three distinct primes multiplying to 105
Use unique factorisation directly.
Factor tree
Read off the triple
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.
Worked Example 3 — system of two prime equations
A genuine AIMO 2013 Q4 problem, treated as a teaching example.
pq + pr = 80 and pq + qr = 425.
Find p + q + r.
pq + pr = p(q + r) and pq + qr = q(p + r). What does each factored equation say about divisibility?
Factor each equation
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
Verify
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.
Worked Example 4 — three integers modified into a GP
A genuine AIMO 2002 Q3 problem, treated as a teaching example.
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.
Set up
Expand
Divisor analysis
121 = \(11^{2}\). Factor pairs (n, p − 20):
Final answer
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.
Worked Example 5 — same skill, fresh framing
Reinforce the "factor + read divisibility" tactic on a different surface form.
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!
Check small primes in order
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.
Phase 4 — Practice Problems
Three problems with progressive hints. Try first; reveal hints/solutions only as needed.
Q: Find all primes p such that p, p + 2, p + 4 are all prime.
Q: What is the largest prime less than 1000?
Q: Find the number of primes strictly between 100 and 200.
Q: Two primes p and q satisfy p + q = 36. How many unordered pairs {p, q} are there?
Q: Three primes p, q, r (not necessarily distinct) satisfy p + q + r = 22. Find the number of ordered triples (p, q, r).
Q: Find all primes p such that 2p + 1 is also prime, and 4p + 1 is also prime, with p ≤ 50.
Q: Two primes p and q satisfy \(p^{2}\) − \(q^{2}\) = 24. Find p + q.
AIMO 2013 · Q4
Exam mode — System of two prime equations. Solve on paper first; hints are on the right.
pq + pr = 80 and pq + qr = 425.
Find the value of p + q + r.
- Keyword identification: "primes" + "two linear equations in pairwise products" → factor-and-divide tactic.
- Known quantities: two constants 80 and 425; the constraint that p, q, r are all prime.
- Unknown quantities: three primes p, q, r — and the sum p + q + r.
- 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.
- 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.
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.
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
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.
Verify
AIMO 2002 · Q3
Exam mode — Three integers modified into a GP. Solve on paper first.
- Keyword identification: "consecutive integers" → set the triple as n, n+1, n+2; "geometric progression" → \(\text{middle}^{2}\) = first × last.
- Known quantities: the second is increased by 10; the third is increased by an unknown prime p; the result is in GP.
- Unknown quantities: the prime p (and the starting integer n).
- 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.
- Hidden constraints: n is a positive integer; p is prime; (p − 20) and n are both positive divisors of 121 = \(11^{2}\).
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.
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
Pairs (n, p−20): (1, 121) → p = 141 = 3·47 ✗; (11, 11) → p = 31 ✓; (121, 1) → p = 21 = 3·7 ✗.
Verify
Modified triple: 11, 22, 44. Ratio = 2. ✓
Largest Prime Factor
Exam mode — Factorise completely, then read off the largest prime factor.
- Keyword identification: "largest prime factor" → build the complete prime factorisation by trial division.
- Known quantities: the number 2024.
- Unknown quantities: the largest prime that divides 2024.
- Intermediate variables: each prime factor found, in increasing order.
- Hidden constraints: the answer must be prime; the product of all prime factors (with multiplicity) equals 2024.
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.
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
So 2024 = \(2^{3}\) × 11 × 23. The prime factors are 2, 11, 23, and the largest is 23.
Verify
Synthesis Problem — primes, parity, bounded search
Combines: small-prime testing + parity argument + bounded enumeration.
Enter the value of p · q · r for any solution you find. (If multiple solutions exist, enter the smallest product.)
Setup with p = 2
Factor 105
105 = 3 · 5 · 7. Factor pairs (with first ≤ second):
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
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.
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.
- Keyword identification: "\(p^{2}\), \(p^{2}\) + 2, \(p^{2}\) + 4" → arithmetic progression with common difference 2 → mod-3 fingerprint.
- Known quantities: the three values are determined by p alone.
- Unknown quantities: primes p; for each, identify the largest prime among {\(p^{2}\), \(p^{2}\) + 2, \(p^{2}\) + 4}.
- Intermediate variables: \(p^{2}\) mod 3 (since \(p^{2}\) + 2 and \(p^{2}\) + 4 cycle through residues mod 3).
- 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\).
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 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.
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:
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
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.
📝 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.
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)
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.
Common pitfalls
- Forgetting that 1 is not prime.
- Computing high powers (\(7^{14}\)) directly instead of factoring.
- Missing the parity argument — not testing p = 2 first when the equation suggests an even outcome.
- Not factoring
pq + prbefore trying to solve. - Failing to verify that the candidate r is actually prime after solving.
When to use these techniques
If a problem mentions any of:
- "p, q, r are primes" or any variable constrained to prime values,
- "largest prime factor of …",
- "three primes summing/multiplying to …",
- An equation like pq + pr = K, or pqr = sum + constant,
… 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.
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.