Names you may know: integer solutions; Diophantine equations by factorization.
Number theory path · N12
Before this lesson: Greatest common divisor and Bézout, Unique prime factorisation, Modular arithmetic and congruences, Solving polynomial equations
← Japan preparation · Adaptive practice · All nine problems
Your goal: Turn an integer equation into a product, then prove that your list of solutions is complete.
Study plan: About 75–100 minutes over two sittings. First study the theory and examples; return for practice and a written proof. Take longer if an idea is new.
Before you start: Expanding brackets, positive and negative factors, prime numbers, and odd/even numbers. Review algebraic identities, divisibility or parity when needed.
A three-minute readiness check
Try these without looking at the answers. Explain one step for each.
- Factor t² − 49.
- Expand (x − 3)(y − 3).
- If u and v are integers, when are both (u + v)/2 and (v − u)/2 integers?
Check your answers and choose a route
1. (t − 7)(t + 7), because 49 = 7². 2. xy − 3x − 3y + 9. 3. Exactly when u and v have the same parity: both even or both odd. Then their sum and difference are even.
If 1 or 2 was difficult, spend a few minutes on the identities lesson before continuing. If 3 was difficult, review parity and try u = 3, v = 7, then u = 3, v = 8. If all three were clear, continue below.
A product gives you a finite list to investigate
The equation x² − y² = 84 seems to allow endlessly many values of x and y. But the identity
x² − y² = (x − y)(x + y)
turns it into a question about factor pairs of 84. There are only finitely many such pairs. This is why factorisation is useful: it replaces an unbounded search with a controlled list.
There is still work to do. A pair of factors must give integers x and y, must satisfy the required signs and inequalities, and must work in the original equation. A useful solution has three parts: transform, restrict, verify.
- TransformFind a product.
- RestrictCheck signs, parity and order.
- VerifyRecover x and y; check every candidate.
Tool 1: recover the variables, not just the factors
Set u = x − y and v = x + y. Adding the equations gives 2x = u + v; subtracting them gives 2y = v − u. Therefore
x = (u + v)/2, y = (v − u)/2.
If x and y are integers, u and v must have the same parity. Conversely, matching parity makes both recovered values integers. When x > y > 0, we also need 0 < u < v. These restrictions remove false candidates before any lengthy calculation.
Tool 2: supply the missing constant
Expand the product (x − a)(y − b):
(x − a)(y − b) = xy − bx − ay + ab.
So an equation xy − bx − ay = c becomes (x − a)(y − b) = c + ab. The added constant is not a trick to memorise blindly: it is the term the expansion needs. Add the same value to both sides to keep the equation equivalent.
Sign check: positive x and y do not automatically make x − a and y − b positive. A positive product can come from two negative factors. Either examine those pairs or explain why they are impossible.
Worked example 1 · Find every pair
Find all positive integers x > y such that x² − y² = 84.
Choose the representation. Put u = x − y and v = x + y. Then uv = 84, 0 < u < v, and u and v have the same parity.
Use parity before listing. Their product is even, so matching parity forces both to be even. Write u = 2a and v = 2b. Now 4ab = 84, so ab = 21 with 0 < a < b. The only pairs are (1, 21) and (3, 7).
| (a, b) | x = a + b | y = b − a | Check |
|---|---|---|---|
| (1, 21) | 22 | 20 | 484 − 400 = 84 |
| (3, 7) | 10 | 4 | 100 − 16 = 84 |
Thus the complete answer is (22, 20) and (10, 4). Every solution produced one of the factor pairs of 21, and both recovered pairs satisfy the original conditions. That explains why the list is complete.
Your turn · Change the parity
Find all positive integers x > y with x² − y² = 45. What changes when the product is odd?
A small hint
Every positive factor of 45 is odd. Use (x − y, x + y) directly.
Full solution
The factor pairs with smaller first are (1, 45), (3, 15), (5, 9). Each has matching parity. Taking half the sum and half the difference gives (23, 22), (9, 6), (7, 2). Their square differences are respectively 529 − 484, 81 − 36 and 49 − 4, all equal to 45. These exhaust the positive factor pairs.
Worked example 2 · Build the product yourself
Find all positive integer pairs (x, y) satisfying xy − 4x − 4y = 9.
Recognise the missing term. The product (x − 4)(y − 4) expands to xy − 4x − 4y + 16. Add 16 to both sides:
(x − 4)(y − 4) = 25.
Check the signs. The two factors have the same sign. If both were negative, positivity of x and y would force each factor to be −3, −2 or −1. Their product would be at most 9, not 25. Neither can be zero. Both are therefore positive.
List and recover. The ordered positive factor pairs of 25 are (1, 25), (5, 5), (25, 1). Adding 4 to each coordinate gives (5, 29), (9, 9), (29, 5).
The product transformation was reversible. Each pair has positive coordinates and product (x − 4)(y − 4) = 25, so subtracting 16 gives the original equation. No other factor pairs remain.
Your turn · Keep track of order
Find all positive integer pairs satisfying xy − 3x − 3y = 7.
A small hint
Add 9, and remember that (x, y) and (y, x) are different ordered pairs unless x = y.
Full solution
We get (x − 3)(y − 3) = 16. If both factors were negative, each would be −2 or −1 and the product would be at most 4. Thus both are positive. The ordered factor pairs are (1, 16), (2, 8), (4, 4), (8, 2), (16, 1). Adding 3 gives (4, 19), (5, 11), (7, 7), (11, 5), (19, 4). Reversing the algebra verifies all five.
Worked example 3 · Make a difference of squares
Find all positive integers n for which n⁴ + 4 is prime.
Trying n = 1, 2, 3 gives 5, 20, 85. These values suggest a pattern, but checking examples cannot exclude all larger n. We need a factorisation that works for every n.
The first and last terms resemble a square. The square (n² + 2)² contains an extra 4n². Subtract it back:
= (n² − 2n + 2)(n² + 2n + 2).
This is a special case of Sophie Germain’s identity:
To derive it, write a⁴ + 4b⁴ = (a² + 2b²)² − (2ab)², then factor the difference of squares. There is no need to guess the final brackets.
Finish with a bound. The first factor for our problem is (n − 1)² + 1. At n = 1 it equals 1, and the whole expression is 5, which is prime. If n ≥ 2, the first factor is at least 2 and the second is larger than 1. The number is then a product of two integers greater than 1, so it is composite. Only n = 1 works.
Why factorisation alone was not enough: 1 × 5 is a factorisation of a prime. We had to prove that both factors exceed 1 before concluding “composite”.
Your turn · Use the identity with a different b
Prove that n⁴ + 64 is composite for every positive integer n.
A small hint
Write 64 = 4 × 2⁴. Complete a square to bound the smaller factor.
Full solution
With a = n and b = 2, the identity gives n⁴ + 64 = (n² − 4n + 8)(n² + 4n + 8). The first factor is (n − 2)² + 4 ≥ 4 and the second is (n + 2)² + 4 > 1. Both are integers greater than 1, so their product is composite for every positive integer n.
Four checks that prevent lost solutions
- Domain: Does “integer” allow negatives? Does “positive” exclude zero? Copy this condition before starting.
- Parity: A factor pair can multiply correctly but give half-integer values when you recover x and y.
- Order: An equation symmetric in x and y still has two ordered solutions unless x = y or a restriction such as x ≤ y removes the reversal.
- Completeness: Checking your candidates proves they work. Explaining why every solution must be one of them proves there are no others.
Choose a starting point and practise
The six-question session draws from the nine problems below. Two consecutive correct answers without hints move the target level up. A mistake moves it down, and a hinted answer keeps it steady. If a level runs out, the closest unused question is chosen.
Foundation checks the tools; Core combines them in integer problems; Stretch adds a hidden transformation, a sign issue or a parameter. These levels describe this lesson, not an exam score. For answer-only rehearsal, use the paper set and ignore the optional choices until you have found an answer.
Interactive practice loads here. You can also use the complete question set below.
The complete practice set
Keep the choices and solutions closed for an answer-only attempt. Give yourself time to find a method; speed can come later. The adaptive session selects six of these nine questions, so this list also lets you practise the questions you have not yet seen.
Foundation · check the tools
1. Positive integers x > y give u = x − y and v = x + y. Which pair (u, v) is possible?
Show optional answer choices
- (3, 8)
- (4, 10)
- (5, 5)
- (2, 7)
Hint 1
Recover x and y by adding and subtracting the two equations.
Hint 2
We need x = (u + v)/2 and y = (v − u)/2 to be positive integers.
Answer and complete solution
(4, 10)
The pair (4, 10) gives x = 7 and y = 3. The pairs (3, 8) and (2, 7) have opposite parity, so the halves are not integers. The pair (5, 5) gives y = 0, which is excluded. Thus only (4, 10) is possible.
Watch out: Check both parity and the strict inequality v > u; matching parity alone does not guarantee y > 0.
Foundation · check the tools
2. If xy − 5x − 5y = 11, which equation is equivalent to it?
Show optional answer choices
- (x − 5)(y − 5) = 11
- (x − 5)(y − 5) = 25
- (x − 5)(y − 5) = 36
- (x − 5)(y − 5) = 61
Hint 1
Expand (x − 5)(y − 5). Which constant appears?
Hint 2
The product is xy − 5x − 5y + 25. Add the same 25 to the other side.
Answer and complete solution
(x − 5)(y − 5) = 36
Expanding gives (x − 5)(y − 5) = xy − 5x − 5y + 25. Therefore its value is 11 + 25 = 36. Subtracting 25 reverses the step, so the two equations have exactly the same solutions.
Watch out: The missing constant is 5 × 5, and it must be added to both sides.
Foundation · check the tools
3. Positive integers a and b satisfy ab = 35. What is the smallest possible value of a + b?
Show optional answer choices
- 10
- 12
- 18
- 36
Hint 1
List positive factor pairs of 35, without repeating reversed pairs.
Hint 2
The pairs with a ≤ b are (1, 35) and (5, 7).
Answer and complete solution
12
Since 35 = 5 × 7, its positive factor pairs, ignoring order, are (1, 35) and (5, 7). Their sums are 36 and 12. The minimum is 12, attained at (5, 7) and (7, 5). This list is exhaustive.
Watch out: A bound for real numbers is not enough: here the variables must be integers and the minimum must be attained.
Core · combine the ideas
4. How many pairs of positive integers (x, y), with x > y, satisfy x² − y² = 180?
Show optional answer choices
- 2
- 3
- 6
- 9
Hint 1
Factor first. The two factors must have the same parity.
Hint 2
They cannot both be odd. Write x − y = 2a and x + y = 2b, so ab = 45 and a < b.
Answer and complete solution
3
Both factors are even because their product is even and their parity matches. Set x − y = 2a and x + y = 2b. Then ab = 45, with a < b positive integers. The pairs are (1, 45), (3, 15), (5, 9). Recovering x = a + b and y = b − a gives (46, 44), (18, 12), (14, 4). Each works, so there are exactly 3 pairs.
Watch out: Counting every factor pair of 180 includes pairs of opposite parity that cannot give integer x and y.
Core · combine the ideas
5. How many positive integer pairs (x, y), with x ≤ y, satisfy 1/x + 1/y = 1/6?
Show optional answer choices
- 3
- 4
- 5
- 9
Hint 1
Multiply by 6xy, then move the linear terms to the same side.
Hint 2
Obtain (x − 6)(y − 6) = 36. Show x and y exceed 6 before listing factor pairs.
Answer and complete solution
5
The equation gives 6x + 6y = xy, hence (x − 6)(y − 6) = 36. Because 1/y > 0, we have 1/x < 1/6, so x > 6; similarly y > 6. The factor pairs with first factor ≤ second are (1, 36), (2, 18), (3, 12), (4, 9), (6, 6). Adding 6 gives (7, 42), (8, 24), (9, 18), (10, 15), (12, 12). Thus there are 5 pairs.
Watch out: The restriction x ≤ y means reversed pairs are not new answers; the equal pair still counts once.
Core · combine the ideas
6. Find the positive integer pair (x, y) satisfying xy + 2x + 3y = 33.
Show optional answer choices
- (1, 10)
- (3, 4)
- (6, 3)
- (10, 1)
Hint 1
The coefficients 2 and 3 suggest (x + 3)(y + 2).
Hint 2
Adding 6 gives a product of 39. Its first factor is at least 4 and its second is at least 3.
Answer and complete solution
(10, 1)
We have (x + 3)(y + 2) = 39. The ordered positive factor pairs of 39 are (1, 39), (3, 13), (13, 3), (39, 1). Since x + 3 ≥ 4 and y + 2 ≥ 3, only (13, 3) is allowed. Thus x = 10 and y = 1; indeed 10 + 20 + 3 = 33.
Watch out: The shifts are different, so reversing the factors does not preserve the positivity conditions or the answer.
Stretch · transfer the method
7. For which integers n is n² + 6n + 5 a prime number? A prime is a positive integer greater than 1.
Show optional answer choices
- n = 0 only
- n = −6 only
- n = −6 or n = 0
- No integer n
Hint 1
Factor the expression. Remember that n is allowed to be negative.
Hint 2
The factors n + 1 and n + 5 differ by 4. A positive prime product allows both positive factors or both negative factors.
Answer and complete solution
n = −6 or n = 0
Factor as (n + 1)(n + 5). If both factors are positive, the smaller must be 1, so n = 0 and the product is 5. If both are negative, the factor closer to zero must be −1, so n + 5 = −1 and n = −6, again giving 5. Opposite signs give a negative product, and a zero factor gives zero. Thus exactly n = −6 and n = 0 work.
Watch out: Factoring a prime into integers does not force a positive factor to be 1 when both factors could be negative.
Stretch · transfer the method
8. For how many positive integers n is n² + 8n + 7 a perfect square?
Show optional answer choices
- 0
- 1
- 2
- Infinitely many
Hint 1
Complete the square: n² + 8n + 7 = (n + 4)² − 9.
Hint 2
If the square is m², with m ≥ 0, then (n + 4 − m)(n + 4 + m) = 9.
Answer and complete solution
1
Let m ≥ 0 be an integer with m² = (n + 4)² − 9. Then m < n + 4, so the two factors n + 4 − m and n + 4 + m are positive. Their product is 9 and the first is no larger than the second. The only pairs are (1, 9) and (3, 3). Adding the factors gives 2(n + 4) = 10 or 6, so n = 1 or −1. Only n = 1 is positive, and it gives 16. The answer is 1.
Watch out: Keep the domain check at the end: the factor pair (3, 3) produces a negative n and must be rejected.
Stretch · transfer the method
9. Let p be a prime. How many positive integer pairs (x, y), with x ≤ y, satisfy 1/x + 1/y = 1/p²?
Show optional answer choices
- 2
- 3
- 4
- 5
Hint 1
Use the same product transformation as in the equation with 1/6.
Hint 2
The product is (x − p²)(y − p²) = p⁴. Every positive factor of p⁴ is a power of p.
Answer and complete solution
3
As 1/y > 0, we have 1/x < 1/p², hence x > p², and similarly y > p². Rearranging gives (x − p²)(y − p²) = p⁴. Unique prime factorisation makes the factor pairs, in increasing order, (1, p⁴), (p, p³), (p², p²). They give three distinct pairs: (p² + 1, p² + p⁴), (p² + p, p² + p³), and (2p², 2p²). Reversing the algebra verifies all three. Thus the answer is 3 for every prime p.
Watch out: Do not test just one prime and assume the result is general: classify the factors of p⁴.
Write a proof of your own
These tasks are written practice. The interactive checker does not grade your proof. Compare your reasoning with the solution and rubric after a serious attempt.
Proof A · Which numbers are differences of squares?
Prove that a positive integer N can be written as x² − y² with integers x > y ≥ 0 if and only if N is not of the form 4k + 2 for an integer k ≥ 0.
Hint 1 · Rule out one remainder
What remainders can an integer square leave on division by 4?
Hint 2 · Build the other cases
For odd N, try two consecutive integers. For N = 4k with k ≥ 1, try x = k + 1.
Full proof and self-check
An even integer has square divisible by 4. An odd integer is 2r + 1, whose square is 4r(r + 1) + 1, leaving remainder 1. A difference of squares can therefore leave remainders 0, 1 or 3 modulo 4, but never 2. This proves necessity.
Conversely, if N is odd and positive, choose x = (N + 1)/2 and y = (N − 1)/2. They are integers with x > y ≥ 0, and (x − y)(x + y) = 1 × N = N. If N = 4k with k ≥ 1, choose x = k + 1 and y = k − 1. Then x > y ≥ 0 and x² − y² = 4k = N. Every positive N not congruent to 2 modulo 4 is either odd or divisible by 4, so the construction covers all allowed cases.
Self-check: Did you prove impossibility as well as existence? Did you include N = 1 and N = 4, where y = 0? Did you verify that both constructions satisfy the domain?
Proof B · A stretch problem with two cases
Find all positive integers n for which is prime.
The exponent now depends on n. First explain why the argument for n⁴ + 4 cannot be copied unchanged.
Hint 1 · Split by parity
When n is even, look for a small common factor. When n is odd, write n = 2k + 1.
Hint 2 · Match the fourth power
For n = 2k + 1, show that , then use Sophie Germain’s identity with a = n and .
Hint 3 · Bound the smaller factor
Write n² − 2nb + 2b² as (n − b)² + b². For odd n ≥ 3, b ≥ 2.
Full proof and self-check
At n = 1 the number is 1 + 4 = 5, which is prime. If n is even, n ≥ 2 and both n⁴ and are divisible by 4. Their sum is greater than 4, so it is composite.
Now let n ≥ 3 be odd. Write n = 2k + 1 with integer k ≥ 1 and put . Then . Sophie Germain’s identity gives
.
The first factor is (n − b)² + b² ≥ b² ≥ 4. The second is (n + b)² + b² ≥ b² ≥ 4. Thus both are integers greater than 1, and the product is composite. Every positive integer is 1, an even integer at least 2, or an odd integer at least 3. We have covered all cases, so n = 1 is the only answer.
Self-check: Did you handle even n? Did you explain the exponent identity? Did you prove both factors exceed 1? Did you check n = 1 separately and state why the cases are exhaustive?
Decide what to do next
If the product was hard to find, revisit the corresponding worked example and explain the transformation aloud. If you found the product but missed a solution, rewrite your factor list with separate columns for signs, parity and order. If the problems were comfortable, write Proof B without opening a hint and return tomorrow to reproduce its central argument.
For JMO preparation, keep practising without choices and compare your progress with official released preliminary papers. Proof work is a separate skill: use the proof-writing guide and the final-round papers to understand what a complete argument needs. This lesson covers one technique, not the whole selection syllabus.
Return to Japan’s pathway · Continue with gcd and integer structure
Prepared for IMOolympiad.com, 26 September 2026. Standard identities and familiar problem types are explained in our own teaching sequence; no official contest attribution is claimed. Japan format checked against the Mathematical Olympiad Foundation of Japan. Official papers remain on the organiser’s site; see its problem-use policy. Report an unclear step or a correction.
Extend the method
Add a linear method to factorisation
For ax+by=c with integer a,b not both zero, solutions exist exactly when gcd(a,b) divides c. If a,b are nonzero and (x₀,y₀) is one solution, all solutions are x=x₀+(b/g)t and y=y₀−(a/g)t, where g=gcd(a,b)>0 and t∈ℤ. Subtract two solutions and use coprimality of a/g,b/g to prove completeness; handle zero coefficients directly.
A modular obstruction
The equation x²+y²=3 has no integer solution. Squares are congruent to 0 or 1 modulo 4, so a sum of two squares can be 0,1 or 2 modulo 4 but never 3. No amount of checking larger values is necessary once this obstruction is proved.
Descent: ruling out a smallest solution
Suppose positive integers satisfy x²=2y². Choose one with smallest y. Parity forces x=2u; then y²=2u² forces y=2v. Substitution gives u²=2v² with 0<v<y, contradicting minimality. Descent must produce another allowed solution with a strictly smaller positive integer measure.
My proof notebook
Write on paper, or keep a draft here. Compare your reasoning with the solution only after a real attempt. The checklist is your own review, not an automatic mark.
Choose your next step
Try a written problem in the challenge room. If this felt difficult, return to a prerequisite above. Every lesson stays open.