Diopantene
Diopantene
NUMBER THEORY
UNIT 3 DIOPHANTINE EQUATIONS
1. Introduction
A Diophantine equation is an equation for which integral solutions are to be found. The most
famous type of Diophantine equations in contemporary mathematics is perhaps those dealt with in
Fermat’s Last Theorem: x n + y n = z n . When n = 2 this just reduces to the usual Pythagorean
identity x 2 + y 2 = z 2 for right-angled triangles, and we are familiar with its positive integer
solutions: (3, 4, 5); (5, 12, 13) etc. Fermat (1601–1665) asserted that when n > 2 , the equation
x n + y n = z n has no solution in positive integers. It was not until 1994 that this was proved by the
English mathematician Andrew Wiles.
Solving a Diophantine equation means finding integer values of the variables (or positive
integers or non-negative integers, depending on the question) which satisfy the equation. The
techniques of solving Diophantine equations are best illustrated using examples. We shall discuss
four specific techniques, namely, algebraic methods, modular arithmetic, inequality bounds and
infinite descent. There is no general rule on which technique to use and the best way to gain
experience is by practice.
2. Algebraic Methods
In algebraic methods, we try to arrange the terms and simplify the equations properly and
apply the basic theorems on divisibility. We usually try to write one side as the product of two or
more factors or take out ‘integer parts’ in the expressions.
Example 2.1.
Find all integers n for which n 2 − 2n + 4 is a multiple of n + 3 .
n 2 − 2n + 4
(This can be considered as the Diophantine equation = k for integers n, k.)
n+3
Page 1 of 10
Mathematical Database
Solution.
Note that
n 2 − 2n + 4 19
= n−5+ .
n+3 n+3
So the condition is satisfied if and only if n + 3 divides 19. Since 19 is prime, n + 3 can only be 19,
1, –1 or –19. Hence we obtain four possible values of n, namely, 16, –2, –4 and –22. It is easy to
check that these values of n satisfy the requirement.
Example 2.2.
5 6
Find all natural numbers x, y for which + = 1.
x y
Solution.
Multiplying both sides by xy and transposing terms, we get xy − 6 x − 5 y = 0 .
To make the left hand side the product of two factors, we add 30 on both sides and factorise:
( x − 5)( y − 6) = 30
Note that the two factors on the left are of the same sign. Moreover, since x, y are both positive, the
two factors must be both positive. Hence the two factors may take values
( x − 5, y − 6) = (1, 30); (2, 15); (3, 10); (5, 6); (6, 5); (10, 3); (15, 2); (30, 1)
3. Modular Arithmetic
The concept of ‘quadratic residues’ also plays an important role in solving Diophantine
equations. An integer c is said to be a quadratic residue modulo m if there exists an integer x such
Page 2 of 10
Mathematical Database
that x 2 ≡ c (mod m). For instance, we know that all squares are either congruent to 0 or 1 modulo 4,
so 0 and 1 are quadratic residues modulo 4, while 2 and 3 are non-residues.
Example 3.1.
Find all integers x, y such that 15 x 2 − 7 y 2 = 9 .
Solution.
Note that 7 y 2 = 15 x 2 − 9 ≡ 1 (mod 5), so y 2 ≡ 3 (mod 5).
Alternative Solution.
Since 3 divides 15 and 9, 3 also divides 7 y 2 and hence 3 divides y.
Consequently, since 9 divides 7 y 2 and 9, it also divides 15x 2 . Thus 3 divides x.
So there is no solution.
Example 3.2.
Find all integer solutions to the equation x3 + 2 y 3 + 4 z 3 = 9 w3 .
Solution.
Clearly, (0, 0, 0, 0) is a solution.
Suppose there is another solution. Without loss of generality, we may assume that x, y, z, w have no
common factor greater than 1, for otherwise we can simply divide the whole equation by the cube
of the common factor.
Now x3 + 2 y 3 + 4 z 3 ≡ 0 (mod 9), but we check that n3 can only be congruent to 1, 0, –1 (mod 9).
The only possibility is that x, y, z are all congruent to 0 (mod 9), i.e. 3 divides x, y and z. But this
implies that the left hand side of the equation is divisible by 27, and thus forces 3 to divide w as
well. This contradicts our assumption that x, y, z, w are relatively prime.
Page 3 of 10
Mathematical Database
Example 3.3.
Find all pairs of prime numbers (p, q) such that p 3 − q 5 = ( p + q ) 2 .
Solution.
Clearly, p = 3 yields no solution while q = 3 yields the solution (7, 3).
Now suppose p, q are not equal to 3. Then p, q ≡ 1 or –1 (mod 3).
Therefore there can be no other solutions. The only solution is (7, 3).
4. Inequality bounds
In many cases, it is obvious that one side of an equation would ‘grow faster’ than the other side
as the variables get large. In such cases solutions to the equations cannot be ‘too large’, and so we
may apply inequalities to establish bounds for the variables.
Example 4.1.
Find all non-negative integers a, b such that a − b = a 2 + ab + b 2 .
Solution.
Clearly the right hand side ‘seems’ to be larger than the left hand side.
Indeed, we have a − b ≤ a ≤ a 2 ≤ a 2 + ab + b 2 .
It is easy to check that (0, 0) and (1, 0) are solutions, and these are the only solutions.
Example 4.2.
Find all integers x, y such that x 3 + y 3 = ( x + y ) 2 .
Page 4 of 10
Mathematical Database
Solution.
Since x3 + y 3 = ( x + y )( x 2 − xy + y 2 ) , x + y is a common factor of both sides. Hence (k , − k ) is a
solution for all integers k.
Now suppose x ≠ − y . We cancel out the common factors on both sides to obtain
x 2 − xy + y 2 = x + y .
By direct checking, we find that (0, 1), (1, 0), (1, 2) and (2, 1) are solutions.
Hence all the solutions are (0, 1), (1, 0), (1, 2) (2, 1) and (k, –k) for any integer k.
Example 4.3.
2a + 1
Find all positive integers a, b such that is an integer.
2b − 1
Solution.
When b = 1, a can be any positive integer.
2a + 1 a −b a − 2b a − qb 2r + 1
=2 +2 +"+ 2 + b ,
2b − 1 2 −1
2r + 1
which cannot be an integer since 0 < < 1.
2b − 1
Hence all the solutions are (k, 1), (2h − 1, 2) where k, h are arbitrary positive integers.
Page 5 of 10
Mathematical Database
5. Infinite Descent
In infinite descent we show that if a positive solution exists, we can always find a ‘smaller’
solution. Since this process cannot carry on indefinitely, we come to the conclusion that the
equation has no positive solutions. Alternatively, we may show that if a positive solution exists, one
or more of the variables must be divisible any power of a certain integer, thereby obtaining a
contradiction.
Example 5.1.
Find all non-negative integers x, y, z such that x3 + 2 y 3 = 4 z 3 .
Solution.
Clearly, (0, 0, 0) is a solution.
Suppose ( x1 , y1 , z1 ) is another solution. Then x is even since 2 y 3 and 4z 3 are even. Write x1 = 2 x2 .
Putting into the equation and dividing by 2, we have
4 x13 + y13 = 2 z13 ,
This process can be repeated again and again, so that x2 , y2 and z2 are all even, and so on.
It follows that x1 , y1 and z1 are divisible by any power of 2, which is not possible unless they are
equal to zero.
Thus the only solution is (0, 0, 0) .
Example 5.2.
(USAMO 1976) Find all non-negative integers a, b, c such that a 2 + b 2 + c 2 = a 2b 2 .
Solution.
We claim that a, b, c must all be even. Recall that the square of an odd integer is always congruent
to 1 (mod 4) and the square of an even integer is always congruent to 0 (mod 4). From the equation,
we see that if a, b are even, then c must be even. If a, b are both odd, the right side is congruent to 1
(mod 4), but the left side cannot be. If exactly one of a and b is odd, then the right side is congruent
to 0 (mod 4), but the left side is not. This establishes the claim.
Page 6 of 10
Mathematical Database
Clearly, (0, 0, 0) is a solution. Suppose there is another solution (a0 , b0 , c0 ) . Recall that all variables
must be even, so we let a0 = 2a1 , b0 = 2b1 and c0 = 2c1 . Putting into the equation and dividing both
sides by 4, we get a12 + b12 + c12 = 4a12b12 . By exactly the same argument as before, we see that a1 ,
b1 and c1 must all be even again. Repeating this argument, a0 , b0 and c0 have to be divisible by
any power of 2, which is not possible unless all of them are zeros.
6. Miscellaneous Examples
The techniques described above are by no means exhaustive. Nor does every problem fit into
one of the above types. In this section we will look at some miscellaneous examples.
Example 6.1.
Prove that the equation x3 + y 3 + z 3 = x 2 + y 2 + z 2 has infinitely many integer solutions.
Solution.
Setting z = − y , we get x3 = x 2 + 2 y 2 .
Hence ( 1 + 2m 2 , m + 2m3 , − m − 2m3 ) is a solution for any integer m, and it is clear that we get
infinitely many solutions as m varies.
Example 6.2.
Prove that for all positive integers n, there exist positive integers x, y, z such that
x 2 + y 2 + z 2 = 421n .
Solution.
If x 2 + y 2 + z 2 = 421n , then (421x) 2 + (421 y ) 2 + (421z ) 2 = 421n + 2 .
Page 7 of 10
Mathematical Database
Example 6.3.
(IMO 1997) Find all pairs (a, b) of integers a ≥ 1 , b ≥ 1 that satisfy the equation a b = b a .
2
Solution.
Let d = gcd (a, b) . Write a = du and b = dv . Then gcd (u, v) = 1 and the equation becomes
(du ) dv = (dv)u .
2
Case 1: dv2 = u
In this case v | u , so we must have u = v = 1 , d = 1 and hence a = b = 1 . We check that (1, 1) is a
solution.
u d = d u −d . (*)
Putting into (*) and comparing powers, we have dα i = (u − d ) β i . So β i < α i for all i, i.e. d | u .
k = d k −2 .
Therefore the only solutions are (1, 1), (27, 3) and (16, 2).
Page 8 of 10
Mathematical Database
7. Exercises
(c) y 2 = x3 + 7
(d) 3 ⋅ 2 x + 1 = y 2
(e) xy + yz + zx = xyz + 2
(f) ( xy − 7) 2 = x 2 + y 2
2. Find all positive integers a, b, n and prime numbers p such that p is prime and p n = a 3 + b3 .
(APMO 1993) Find all positive integers n such that the equation x n + ( 2 + x ) + ( 2 − x ) = 0 has
n n
3.
an integer solution.
4. Prove that for all positive integers n, there exist integers x and y such that x 2 + xy + y 2 = 7 n .
5. Let a, b, c be positive integers. The triple (a, b, c) is called a Pythagorean triple if it satisfies
a 2 + b 2 = c 2 (i.e. the triangle with side lengths a, b, c is right-angled at the angle opposite the
side with length c). If the G.C.D. of a, b, c is 1, then it is called a primitive solution.
(a) Show that if (a, b, c) is a Pythagorean triple, then so is (ka, kb, kc) for any positive integer
k.
(b) Let u, v be relatively prime natural numbers of opposite parity and u > v . Show that
( u 2 − v 2 , 2uv, u 2 + v 2 )
is a primitive solution to the equation a 2 + b 2 = c 2 .
(c) Follow the steps below to show that every primitive solution is of the form in (b).
(1) Let (a, b, c) be a primitive solution. Then a and b are of different parity.
c+a c−a
2
b
(2) Set m = , n= . Then mn = .
2 2 2
Page 9 of 10
Mathematical Database
6. Using infinite descent, show that the equation x 4 + y 4 = z 2 has no solution in positive integers.
(This proves Fermat’s Last Theorem for the case n = 4.)
7. (IMO 1998) Determine all pairs (a, b) of positive integers such that ab 2 + b + 7 divides
a 2b + a + b .
Page 10 of 10