✓ Official Syllabus VerifiedStandards & Rigor ↗
🏆 Subsection I · Core International Olympiad Pillars (Chapters 1–8)
3

Number Theory II: Diophantine Equations, SFFT, Bounding & Vieta Jumping

🧩 Core Pillar 3 — Olympiad Number Theory II IMO · NSMO · KAUST KMC  ·  Linear Diophantine equations & Chicken McNugget Theorem  ·  Simon's Favorite Factoring Trick (SFFT)  ·  Modular quadratic obstructions & infinite descent  ·  Inequality bounding & discriminant tests  ·  Vieta root flipping (IMO 1988 Q6 technique)

A Diophantine equation asks for integer (or positive integer) solutions to a polynomial equation with fewer equations than unknowns. Because integers are discrete, Olympiad solvers unlock Diophantine equations using five decisive weapons: factoring into divisor pairs (SFFT), modular contradictions, monotonic inequality bounding, Fermat infinite descent, and Vieta root flipping.

● Definition 3.1 — Linear Parameterization, Chicken McNugget & SFFT

1. Linear Diophantine Theorem: ax + by = c has integer solutions iff d = gcd(a,b) \mid c. Given one particular solution \( (x_0, y_0) \), ALL integer solutions are parameterized by \( t \in \mathbb{Z} \):

\[ x = x_0 + \frac{b}{d}t, \qquad y = y_0 - \frac{a}{d}t. \]

2. Frobenius Coin (Chicken McNugget) Theorem: For coprime \( a, b > 1 \), the largest integer NOT representable as \( ax + by \) with \( x, y \in \mathbb{Z}_{\ge 0} \) is \( ab - a - b \), and exactly \( \frac{(a-1)(b-1)}{2} \) non-negative integers are non-representable.

3. Simon's Favorite Factoring Trick (SFFT): Every bilinear equation \( xy + rx + sy = c \) factors by adding \( rs \) to both sides:

\[ (x + s)(y + r) = c + rs. \]
● Theorem 3.2 — Pythagorean Triples, Floor Hermite Identity & Vieta Jumping

1. Primitive Pythagorean Triples: Every solution to \( x^2 + y^2 = z^2 \) in coprime positive integers (with \( x \) odd, \( y \) even) has the form \( x = m^2 - n^2,\; y = 2mn,\; z = m^2 + n^2 \) for coprime \( m > n \ge 1 \) of opposite parity.

2. Hermite's Floor Identity: For any real \( x \) and positive integer \( n \), \( \sum_{k=0}^{n-1} \left\lfloor x + \frac{k}{n} \right\rfloor = \lfloor nx \rfloor \).

3. Vieta Root Flipping (IMO 1988 Q6): When a symmetric quadratic Diophantine relation \( x^2 - kxy + y^2 + c = 0 \) holds, fixing \( y \) and viewing it as a quadratic in \( x \) with one integer root \( x_1 \) produces a second integer root \( x_2 = ky - x_1 = \frac{y^2 + c}{x_1} \), jumping to a strictly smaller minimal solution unless \( c \) forces a fixed value of \( k \)!

◆ Proof — Classic IMO 1988 Problem 6 Core Step via Vieta Jumping

Suppose \( a, b \in \mathbb{Z}^+ \) satisfy \( \frac{a^2 + b^2}{ab + 1} = k \in \mathbb{Z}^+ \). Assume \( k \) is NOT a perfect square, and among all positive integer solutions \( (a, b) \) for this fixed \( k \), choose the pair minimizing \( a + b \), with \( a \ge b \ge 1 \). Rewrite as a quadratic in \( x = a \): \( x^2 - (kb)x + (b^2 - k) = 0 \). One root is \( x_1 = a \); by Vieta, the second root satisfies:

\[ x_2 = kb - a \in \mathbb{Z} \qquad \text{and} \qquad x_2 = \frac{b^2 - k}{a}. \]

Since \( k \) is not a square, \( x_2 \ne 0 \). If \( x_2 < 0 \), then \( x_2 \le -1 \implies x_2^2 - kbx_2 + b^2 - k \ge 1 + kb + b^2 - k = b^2 + k(b-1) + 1 > 0 \), contradicting \( x_2 \) being a root! Thus \( x_2 \ge 1 \) is a positive integer, AND \( x_2 = \frac{b^2 - k}{a} < \frac{a^2}{a} = a \), contradicting the minimality of \( a + b \)! Therefore \( k \) must be a perfect square. \( \blacksquare \)

Olympiad Diophantine Diagnostic Matrix: Matching Equation Shape to Method
Equation StructurePrimary Olympiad TechniqueKey Reduction
\(\frac{1}{x} + \frac{1}{y} = \frac{1}{n}\) or \(xy + ax + by = c\)Simon's Favorite Factoring Trick (SFFT)\((x - n)(y - n) = n^2\) → count \(\tau(n^2)\) divisors
\(x^2 - dy^2 = N\) or \(x^2 + y^2 = 4k + 3\)Modular Residue Obstruction\(x^2 + y^2 \equiv 0, 1, 2 \pmod 4\) → never \(3 \pmod 4\)!
\(\frac{1}{x} + \frac{1}{y} + \frac{1}{z} = 1\) (symmetric)WLOG Ordering & Bounding\(1 \le \frac{3}{x} \implies x \in \{2, 3\}\), reducing to 2 variables!
\(2^x - 3^y = \pm 1\) (Exponential Diophantine)Parity / Mod \(3, 4, 8\) + Difference of SquaresEven exponent forces \((2^{x/2}-1)(2^{x/2}+1) = 3^y\)
Unit-Fraction Formula
Ordered positive solutions to \(\frac{1}{x} + \frac{1}{y} = \frac{1}{n}\) equal \(\tau(n^2)\)
Consecutive Square Squeeze
No integer square lies strictly between \(n^2\) and \((n+1)^2 = n^2+2n+1\)!
Discriminant Integrality
If \(ax^2+bx+c=0\) has \(x \in \mathbb{Z}\), then \(\Delta = b^2 - 4ac = m^2\) for some \(m \in \mathbb{Z}_{\ge 0}\)
Floor Decomposition
Always write \(x = n + r\) with \(n = \lfloor x \rfloor \in \mathbb{Z}\) and \(0 \le r < 1\)
Geometric meaning of SFFT: \(xy - 3x - 2y = 0 \iff (x - 2)(y - 3) = 6\) is a rectangular hyperbola with asymptotes \(x = 2\) and \(y = 3\); its integer lattice points correspond 1-to-1 with the \(2\tau(6) = 8\) signed divisors of \(6\).
⊙ Explorer · SFFT Hyperbola Lattice & Divisor-Pair Solutions Lab
interactive
Positive Divisors \(\tau(N)\)τ(6) = 4
Total \(\mathbb{Z}^2\) Solutions \(2\tau(N)\)8 lattice pts
Closest Pair \((x, y)\)(4, 5)

Vary \(a\) and \(N\) to watch the hyperbola \((x - a)(y - a) = N\) pass through integer grid intersections. Notice prime values of \(N\) yield only \(4\) total integer points, while highly composite \(N = 12, 18\) light up \(12\) lattice solutions!

Consecutive-square bounding in action: for \(x > 1\), \((x+1)^2 = x^2+2x+1 < x^2+3x+5 < x^2+4x+4 = (x+2)^2\) whenever \(x > 1\), trapping \(y^2\) strictly between two consecutive squares and leaving only finite check \(x = 1 \implies y = \pm 3\)!
Worked Example 3.A — Counting Unit-Fraction Solutions via SFFT (AMC 10/12 & NSMO)
Problem. How many ordered pairs of positive integers \( (x, y) \) satisfy \( \frac{1}{x} + \frac{1}{y} = \frac{1}{18} \)?
▸ Show step-by-step solution

Clear denominators (noting \( x, y > 18 \) since \( \frac{1}{x} < \frac{1}{18} \)):
\[ 18(x + y) = xy \iff xy - 18x - 18y = 0. \]
Add \( (-18)(-18) = 324 \) to both sides (SFFT):
\[ (x - 18)(y - 18) = 324 = 2^2 \cdot 3^4. \]
Since \( x, y \ge 1 \), we have \( x - 18 > -18 \) and \( y - 18 > -18 \). If \( x - 18 < 0 \), both factors are negative with product \( 324 \), which is impossible since \( (-17)(-17) = 289 < 324 \)! Thus every positive divisor \( d \mid 324 \) gives a unique valid positive pair \( x = 18 + d,\; y = 18 + \frac{324}{d} \).
The number of ordered pairs is \( \tau(324) = (2 + 1)(4 + 1) = 15 \).

Worked Example 3.B — Exponential Diophantine Equation (NSMO Stage 3 / BMO)
Problem. Find all pairs of non-negative integers \( (x, y) \) satisfying \( 3^x - 2^y = 7 \).
▸ Show step-by-step solution


1. Check small \( y \) first: \( y = 0 \implies 3^x = 8 \) (no); \( y = 1 \implies 3^x = 9 \implies (x, y) = (2, 1) \); \( y = 2 \implies 3^x = 11 \) (no).
2. Now assume \( y \ge 3 \), so \( 8 \mid 2^y \), meaning \( 2^y \equiv 0 \pmod 8 \). Reducing the equation modulo \( 8 \) gives \( 3^x = 2^y + 7 \equiv 7 \pmod 8 \). However, powers of \( 3 \pmod 8 \) alternate exclusively between \( 1 \) and \( 3 \) (\( 3^{2k} \equiv 1,\; 3^{2k+1} \equiv 3 \pmod 8 \)) and can never equal \( 7 \pmod 8 \)!
Therefore \( (x, y) = (2, 1) \) is the unique solution in non-negative integers!

Worked Example 3.C — Consecutive-Square Bounding in Quartic/Quadratic Equations (KAUST KMC)
Problem. Find all positive integers \( n \) such that \( n^4 + 2n^3 + 2n^2 + 2n + 1 \) is a perfect square.
▸ Show step-by-step solution

Compare \( E(n) = n^4 + 2n^3 + 2n^2 + 2n + 1 \) with nearby squares of monic quadratics \( (n^2 + n + c)^2 \):
1. Lower square: \( (n^2 + n)^2 = n^4 + 2n^3 + n^2 < E(n) \) for all \( n \ge 1 \) (since \( n^2 + 2n + 1 = (n+1)^2 > 0 \)).
2. Upper square: \( (n^2 + n + 1)^2 = n^4 + 2n^3 + 3n^2 + 2n + 1 \). Comparing with \( E(n) \):
\[ (n^2 + n + 1)^2 - E(n) = n^2 > 0 \quad \text{for all } n \ge 1. \]
Hence for every positive integer \( n \ge 1 \),
\[ (n^2 + n)^2 < n^4 + 2n^3 + 2n^2 + 2n + 1 < (n^2 + n + 1)^2! \]
Because \( E(n) \) is strictly trapped between two consecutive integer squares, there are zero positive integer solutions! (Algebraic confirmation: \( E(n) = (n^2 + 1)(n + 1)^2 \), which is a square iff \( n^2 + 1 \) is a square — impossible for \( n \ge 1 \)!)

Worked Example 3.D — Fractional-Part Floor-Sum Jump Analysis (AIME / KAUST Finals)
Problem. Among the \( 60 \) integers \( \{0, 1, 2, \dots, 59\} \), how many can NEVER be expressed in the form \( g(x) = \lfloor x \rfloor + \lfloor 2x \rfloor + \lfloor 3x \rfloor \) for any real number \( x \)?
▸ Show step-by-step solution

Write \( x = n + r \) where \( n = \lfloor x \rfloor \in \mathbb{Z} \) and \( r = \{x\} \in [0, 1) \). Then:
\[ g(x) = n + (2n + \lfloor 2r \rfloor) + (3n + \lfloor 3r \rfloor) = 6n + \lfloor 2r \rfloor + \lfloor 3r \rfloor. \]
Partition \( r \in [0, 1) \) at the jump thresholds \( \frac{1}{3}, \frac{1}{2}, \frac{2}{3} \):
• \( r \in [0, \frac{1}{3}) \implies 0 + 0 = 0 \)
• \( r \in [\frac{1}{3}, \frac{1}{2}) \implies 0 + 1 = 1 \)
• \( r \in [\frac{1}{2}, \frac{2}{3}) \implies 1 + 1 = 2 \)
• \( r \in [\frac{2}{3}, 1) \implies 1 + 2 = 3 \).
Thus in every block of \( 6 \) consecutive integers \( \{6n, 6n+1, \dots, 6n+5\} \), \( g(x) \) attains the \( 4 \) residues \( 6n + \{0, 1, 2, 3\} \) and strictly skips the \( 2 \) residues \( 6n + 4 \) and \( 6n + 5 \)! Since \( \{0, 1, \dots, 59\} \) consists of \( 10 \) complete blocks of length \( 6 \), exactly \( 10 \times 2 = 20 \) integers are skipped.

⚠ Olympiad Trap — Forgetting Negative Divisors & Zero Edge Cases in SFFT

When solving \( (x + s)(y + r) = N \), carefully read whether the domain specifies all integers \( \mathbb{Z} \), non-negative integers \( \mathbb{Z}_{\ge 0} \), or positive integers \( \mathbb{Z}^+ \)! Over \( \mathbb{Z} \), every negative divisor pair \( (-d, -N/d) \) is also valid, doubling the count to \( 2\tau(|N|) \); over \( \mathbb{Z}^+ \), you must explicitly filter out pairs that yield \( x \le 0 \) or \( y \le 0 \).

▲ Contest Strategy — Coprime GCD Factoring for Powers

Whenever \( AB = z^k \) in positive integers (such as \( n(n+1) = z^2 \) or \( (x-1)(x+1) = 3^y \)), compute \( g = \gcd(A, B) \) FIRST! Since \( \gcd(n, n+1) = 1 \), BOTH \( n \) and \( n+1 \) would have to be individual \( k \)-th powers — immediately forcing \( n = 0 \)!

[Practice 3.1 · NSMO Stage 1 / Easy] What is the largest positive integer that CANNOT be written in the form \( 7a + 11b \) for non-negative integers \( a, b \ge 0 \)?
💡 Hint 1 of 3
Check that \( \gcd(7, 11) = 1 \), so the Frobenius Coin (Chicken McNugget) theorem applies.
💡 Hint 2 of 3
Recall the formula \( ab - a - b \) for non-negative coefficients.
💡 Hint 3 of 3
Compute \( 7 \times 11 - 7 - 11 \).
By the Chicken McNugget Theorem for coprime \( 7 \) and \( 11 \), the largest non-representable integer is \( 7(11) - 7 - 11 = 77 - 18 = 59 \).
[Practice 3.2 · KAUST KMC / Easy] Find the sum \( x + y \) for the unique pair of positive integers \( (x, y) \) with \( x \le y \) satisfying \( xy + 3x + 5y = 62 \).
💡 Hint 1 of 3
Add \( 3 \times 5 = 15 \) to both sides to factor via SFFT.
💡 Hint 2 of 3
Rewrite as \( (x + 5)(y + 3) = 62 + 15 = 77 = 7 \times 11 \).
💡 Hint 3 of 3
Since \( x \ge 1 \implies x + 5 \ge 6 \) and \( y \ge 1 \implies y + 3 \ge 4 \), match \( (7, 11) \) or \( (11, 7) \) with \( x \le y \).
Adding \( 15 \) to both sides yields \( (x + 5)(y + 3) = 77 \). Since \( x + 5 \ge 6 \) and \( y + 3 \ge 4 \), the factor pairs of \( 77 \) are \( (7, 11) \implies (x, y) = (2, 8) \) and \( (11, 7) \implies (x, y) = (6, 4) \). With \( x \le y \), \( (x, y) = (2, 8) \) and \( x + y = 10 \).
[Practice 3.3 · NSMO Stage 2 / Medium] How many pairs of integers \( (x, y) \in \mathbb{Z}^2 \) satisfy \( x^2 - 4y^2 = 2026 \)?
💡 Hint 1 of 3
Reduce the entire equation modulo \( 4 \)!
💡 Hint 2 of 3
Notice \( -4y^2 \equiv 0 \pmod 4 \), while \( 2026 = 4(506) + 2 \equiv 2 \pmod 4 \).
💡 Hint 3 of 3
What are the possible residues of \( x^2 \pmod 4 \)?
Reducing modulo \( 4 \) gives \( x^2 \equiv 2026 \equiv 2 \pmod 4 \). However, every integer square satisfies \( x^2 \equiv 0 \) or \( 1 \pmod 4 \), never \( 2 \pmod 4 \). Hence there are \( 0 \) integer solutions.
[Practice 3.4 · AIME / KAUST KMC / Hard] Find all ordered triples of positive integers \( (x, y, z) \) with \( x \le y \le z \) satisfying \( \frac{1}{x} + \frac{1}{y} + \frac{1}{z} = 1 \), and compute the largest possible value of \( z \).
💡 Hint 1 of 3
Since \( x \le y \le z \), \( 1 = \frac{1}{x} + \frac{1}{y} + \frac{1}{z} \le \frac{3}{x} \implies x \in \{2, 3\} \) (since \( x = 1 \) leaves \( 0 \)).
💡 Hint 2 of 3
For \( x = 3 \), \( \frac{1}{y} + \frac{1}{z} = \frac{2}{3} \le \frac{2}{y} \implies y = 3, z = 3 \).
💡 Hint 3 of 3
For \( x = 2 \), solve \( \frac{1}{y} + \frac{1}{z} = \frac{1}{2} \iff (y - 2)(z - 2) = 4 \) for \( 2 \le y \le z \).
For \( x = 2 \), \( (y - 2)(z - 2) = 4 \) gives \( (y-2, z-2) \in \{(1,4), (2,2)\} \), yielding \( (2, 3, 6) \) and \( (2, 4, 4) \). Together with \( (3, 3, 3) \), there are three ordered solutions and the largest \( z \) is \( 6 \).
[Practice 3.5 · NSMO National Finals / Vieta Jumping] Suppose positive integers \( a, b \) satisfy \( \frac{a^2 + b^2}{ab - 1} = k \) for a positive integer \( k \). Find the sum of ALL possible integer values of \( k \).
💡 Hint 1 of 3
Apply Vieta root flipping on a minimal pair \( a \ge b \ge 1 \) for \( x^2 - kbx + (b^2 + k) = 0 \).
💡 Hint 2 of 3
Here \( x_2 = \frac{b^2 + k}{a} > 0 \) is ALWAYS positive! Minimality forces \( x_2 \ge a \implies b^2 + k \ge a^2 \), or check small base pairs \( (a, b) = (2, 1) \) and \( (3, 2) \)!
💡 Hint 3 of 3
At \( (a, b) = (2, 1) \) and \( (3, 1) \), \( k = \frac{4 + 1}{2 - 1} = \frac{9 + 1}{3 - 1} = 5 \)! Check that \( a = b \) gives \( (a^2 - 1) \mid 2 \) (impossible for \( ab > 1 \)) and Vieta descent reduces any \( a > b \ge 2 \) down to \( b = 1 \).
By Vieta jumping on minimal \( (a, b) \) with \( a > b \) (since \( a = b \ge 2 \implies a^2 - 1 \mid 2 \), impossible), if \( b \ge 2 \) and \( x_2 \ge a \), careful descent shows every solution reduces to \( b = 1 \), where \( k = \frac{a^2 + 1}{a - 1} = a + 1 + \frac{2}{a - 1} \). Thus \( (a - 1) \mid 2 \implies a \in \{2, 3\} \), both giving \( k = 5 \)! Hence \( k = 5 \) is the ONLY possible integer value.

Number Theory II: Diophantine Equations, SFFT, Bounding & Vieta Jumping — Competition Proof Benchmark

6 pts No Calculator
For positive integer \(n\) and quadratic \(P(x) = x^2 + 4x + 17\) in Number Theory II: Diophantine Equations, SFFT, Bounding & Vieta Jumping, examine algebraic invariants below.
  1. (a)2 pts
    Express \(4P(x)\) as a square plus a positive constant.
    Scoring Guideline & Justification
    • [M1] Completes square on 4x^2 + 16x (1 pt)
    • [A1] Obtains (2x + 4)^2 + 52 (1 pt)
  2. (b)2 pts
    Deduce why \(P(n)\) has no real roots for any \(n\in\mathbb{R}\).
    Scoring Guideline & Justification
    • [M1] Bounds squared term >= 0 (1 pt)
    • [A1] Proves strict positivity for all real x (1 pt)
  3. (c)2 pts
    Find the remainder when \(P(10) - P(0)\) is divided by \(10\).
    Scoring Guideline & Justification
    • [M1] Computes 100 + 10k = 10(10 + k) (1 pt)
    • [A1] States remainder is 0 (1 pt)
Complete Worked Solution
(a) \(4P(x) = (2x+4)^2 + 52\). (b) Strictly positive discriminant check: \(4P(x) > 0\). (c) \(P(10)-P(0) = 10(10+4) \equiv 0 \pmod{10}\).
📝 Chapter Quiz