Diophantine Equation
Diophantine Equation
Aayush Kumar
October 2024
Contents
§1 Prerequisites 2
§2 Introduction 2
§3 Factoring equations 2
§5 Modular Contradiction 4
§5.1 Some important relations: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
§6 Infinite Descent 5
§7 Vieta Jumping 7
§8 Pell’s Equations 9
1
Diophantine Equation Aayush Kumar
§1 Prerequisites
Nothing fancy as such, the reader is assumed to be comfortable with Modular Arithmetic. I would
highly encourage the reader to give the problems an honest attempt before looking at the solutions.
§2 Introduction
We will start with solving equations using factorization then we will move onto Modular Con-
tradiction and then we’ll end this with discussing Pell’s Equation.
§3 Factoring equations
We’ll start this with an easy example just to show how to get started on the basic questions, most
of you would have done this type anyway.
x2 − y 2 = 24
Solution: On factoring, we get (x + y)(x − y) = 24. So, we have two integers multiplying to give
24, so they can be ± (1, 24), ± (2, 12), ± (3, 8), ± (4, 6). Let us suppose that we get 24 by multiplying
(a, b), then without loss of generality, we have x + y = a and x − y = b. Adding both equations, we
get x = a+b2 . So, a+b must be even, so we are left with only ± (2, 12) and ± (4, 6) cases. We solve
these cases to get (x, y) = (7, 5) , (7, −5) , (−7, 5) , (−7, −5) , (5, 1) , (5, −1) , (−5, 1) , (−5, −1).
To get all the solutions, note that if (a,b) multiplies to give 24 then so does (b,a). ■
2
Diophantine Equation Aayush Kumar
Solution: Substitute m2 = x and n2 = y to get x+3xy = 30y +517 which gives x+3xy −30y =
517. Take 3y common to get 3y (x − 10) + x = 517. Now see that this can be easily factorized
into (x − 10) (3y + 1) = 507 after adding −10 to both side. Now we need to find two integers that
multiply to give 507 and then do some casework to get (x, y) and then ultimately get (m, n). So
the possible pairs of integer which can be multiplied to get 507 are (1, 507), (3, 169) and (13, 39)
but we don’t need to solve these many cases since observe that one of the integer is of the form
(3y + 1) and y ̸= 1 so the only possible pair of integers is (39, 13) which gives (x, y) to be (49, 4),
so (m, n) = (7, 2). ■
Q: If n is positive and there are exactly 2005 ordered pairs (x, y) of positive integers satis-
fying:
1 1 1
+ =
x y n
then prove that n is a perfect square.
and,
2005 = 1 × 2005
= 5 × 401
Hence, we find that either n = 1 and α1 = 1002 or n = 2 and (α1 , α2 ) = (2, 200). So, n is either =
p1002
1 or n = p21 .p200
2 and clearly in both cases n is a perfect square. ■
3
Diophantine Equation Aayush Kumar
§5 Modular Contradiction
This is one of the most important techniques you will learn to solve equations involving exponents
on a math contest. This is where your experience with Modular Arithmetic comes through. There’s
not much theory except for some relations which are stated below. Their proof is left as an exercise
for the reader.
For their proof and creating other such relations I would suggest you to keep Fermat’s Little
Theorem and Euler’s Theorem in mind.
Let’s see some of it’s application now.
Solution: Any Pythagorean triple (x, y, z) are integers satisfying the equation
x2 + y 2 = z 2
The only possible values of the equation (mod 5) are {0, 0, 0}, {0, 1, 1}, {0, −1, −1}, {1, 1, 1},
{−1, −1, −1} (why?) and their permutations. Clearly, last two cases don’t hold and in any
other cases at least one of the numbers is divisible by 5. ■
4
Diophantine Equation Aayush Kumar
USAMTS
3m + 3n + 1 = x2
3odd ≡ 3 (mod 8)
and
3even ≡ 1 (mod 8)
m n 2
So, 3 + 3 + 1 ≡ {3, 5, 7} (mod 8) whereas x ≡ 1 (mod 8).
Hence no solution is possible. Also note that there would’ve have been no solution even if x
was allowed to be any integer. ■
Solution: Observe that x10 ≡ 0, 1 (mod 11) using Fermat’s Little Theorem. So we
have, x5 ≡ 0, 1, −1 (mod 11). So, we have x5 − 4 ≡ 6, 7, 8 (mod 11). But, y 2 is always
{0, 1, 3, 4, 5, 9} (mod 11). So, we have no solution to the given equation over integers. ■
Exercise
x2 − y! = 2001
§6 Infinite Descent
Infinite Descent is a classic method, famously used by F ermat, where we assume a solution
exist and then keep producing smaller and smaller ones which leads to contradiction, because
the positive integers can’t descend forever. Let’s see this technique in action using an easy
problem first and then we’ll do a few problems that has appeared on contests.
5
Diophantine Equation Aayush Kumar
a3 + 3b3 = 9c3
Solution: Clearly (0,0,0) works, now all we need to proof is there exist no solution over
positive integers and for that we’ll take the help of infinite descent. Clearly, 3|a3 which
implies that 3|a. So, a = 3k1 . Then
Dividing by 3 gives us
b3 + 9k13 = 3c3
Now clearly, 3|b as well so b = 3k2 which gives us
which is similar to our original equation. So, if (a, b, c) satisfies the equation so does
(k1 , k2 , k3 )
where k1 = a3 , k2 = 3b , k3 = 3c . So we started with (a, b, c) and got to a3 , 3b , 3c and this will
continue forever and we’ll keep getting a chain of solutions
a b c a b c
(a, b, c) → , , → , , → ....
3 3 3 9 9 9
As we can see this will clearly descend forever but positive integers can’t, so it’s a contradiction
which implies we have no solution over positive integers. ■
Hungarian MO 2000
Q: Find all positive primes p for which there exist positive integers x, y and n such
that
p n = x3 + y 3
Solution: It could be easily checked that for p = 2 and 3 one can easily find n, x and y which
satisfies the given equation using casework and that is left for the reader to do.
Claim: There exist no such integers ∀ p ≥ 5.
Proof: For the sake of contradiction, let there exist a p ≥ 5 that satisfies the given equation,
then observe that at least one of x and y has to be greater than 1 (WLOG, say x). Also,
6
Diophantine Equation Aayush Kumar
and this equation is identical to our original equation which means if n is a solution then so
is n − 3 so, we’ll again get a chain of solution
(n, x, y) → (n − 3, k1 , k2 ) → (n − 6, z1 , z2 ) → ...
Clearly this chain of solution also descends forever but again positive integers can’t, so it’s a
contradiction again. Hence, no prime ≥ 5 is possible.■
Exercise
Q:(PUTNAM,1973): Let a1 , a2 , ....a2n+1 be a set of integers such that, if any one of them
is removed, the remaining ones can be divided into two sets of n integers having equal sums.
Then, prove that a1 = a2 ..... = a2n+1 .
Q: (Fermat’s Last Theorem for n=4) Prove that there exists no integer solution for the
equation
a4 + b4 = c4
§7 Vieta Jumping
Vieta Jumping is a particular kind of descent technique. Let’s see how we can apply this on
contest problems. This is taught using a classic IMO problem from 1988 in almost all the
Maths Olympiads Classes even today in 2025. So, we’ll do the same as well.
IMO 1988 P6
a2 + b2
ab + 1
is the square of an integer.
2 2
Solution: Let k = aab+1 +b
. Clearly, k is a positive integer(why?) but the problem asks us
to prove that it’s not just any integer, but it’s actually square of an integer. For the sake of
7
Diophantine Equation Aayush Kumar
8
Diophantine Equation Aayush Kumar
To get a descent we also need to prove that y < b. This can be proved just like how we showed
x < a, so this is left for the reader. Now, this is a infinite descent as our chain of solution is
with a+b < x+b < y+x. Hence, we went from positive to ”smaller” positive pairs (how do you
really compare pairs??, that’s why we talk about the sum of the pairs) but this process can’t
go on forever, so this leads to a Contradiction which means k is in fact a perf ect square . ■
Exercise
Q:(Korean Mathematical Olympiad) Prove that x2 + y 2 + z 2 = 2xyz has no solution
over integers except (0, 0, 0).
Note: (Be careful that you can’t apply infinite descent directly here since x, y, z are not
necessarily only positive integers.)
§8 Pell’s Equations
Any equation of the form of x2 − Dy 2 = 1 where D is a positive integer but not a perfect
square is called a Pell’s Equation. There’s actually a lot of controversy over the name as
Pell had nothing to do with the solution of these equations. The first mathematician known
to have done some significant work on these types of equations was Brahmagupta from India
when he found positive integer solutions to the equation x2 − 92y 2 = 1.
Theorem 8.1: There always exist a solution (x, y) to a Pell’s Equation. The proof
of this beautiful theorem actually comes from Continued Fractions which is out
of scope of this material (and you can use this theorem on contest without actually
proving it.) Even though, we won’t prove this theorem, We’ll still want to understand
how continued fractions help us find what’s called the Fundamental Solution.
Theorem 8.2: Given that there exists one solution (x0 , y0 ) to a Pell’s equation, we
can actually find an infinte number of solutions to the equation, with (x0 , y0 ) being
the smallest. The smallest solution is what we call as the Fundamental Solution.
N (z) = z z̄ = x2 − dy 2
9
Diophantine Equation Aayush Kumar
2 2
√ get back our original equation x −Dy =
The proof is simple and left for the reader. Now, let’s
1. Observe that if we define a number z = x + y D, then it satisfies that
N (z) = x2 − Dy 2 = 1
. Also notice that if N (z) = 1, then so is N (z 2 ) since
N (z 2 ) = N (z)N (z) = 1
, in fact we have
N (z k ) = N (z)N (z)... = 1
for any natural number k. Hence, if z satisfies the equation, then so does z k . So, we went
from one solution to infinitely many. ■
Theorem 8.3: Let√d be a positive integer which is not a perfect square. Then there
exists ϵ = x0 + y0 d with (x0 , y0 ) ∈ N such that every solution (x, y) to the Pell’s
Equation is found by √ √
x + y d = ϵn = (x0 + y0 d)n
for some integer n.
This theorem actually states that every solution to a Pell’s equation is given by some natural
power of the fundamental solution. √
Proof: Let α be the smallest √ real number of the form of x + y d greater than 1 with it’s
norm = 1. Now, let β = a+b d be another real number such that (a, b) satisfies the equation
X 2 − DY 2 = 1. Let k be such that
αk ≤ β < αk+1
Let
β √ √
γ= k
= (a + b d)(x − y d)k
α
√
Now, clearly N (γ) = 1 and on expanding γ comes out √ to be of the√form of r + s d. Note
that γ ≥ 1 which means γ̄ ≤ 1 (why?). Hence,
√ r − s d ≤ 1 ≤ r + s d, showing r and s are
non negative. Notice that since γ = r + s d with norm = 1, this also satisfies our original
equation X 2 − DY 2 = 1 and γ < α, so it contradicts the minimality of α unless γ = 1, which
implies β = αk . ■
Now, let’s do an example on how we find different solutions using the known fundamental
solution.
10
Diophantine Equation Aayush Kumar
Solution: We need to either guess our fundamental solution or find it using continued frac-
tion, for smaller values of d like 3, I would recommend you to first at least try to guess the
smallest solution instead of using continued fraction as it gets very messy (by guessing, I √
ac-
tually mean checking by hit and trial). Clearly, (2, 1) is the smallest solution. So z = 2 + 3
works. Now we √ know other numbers that would actually work will all be of the form z k .
that √
2 2
So, z = (2 + 3) = 7 + 4 3 works. Hence, we get another solution (x, y) = (7, 4). Similarly
we can find other solutions by raising different natural powers of z. ■
√
§9.1 Representing d as a continued fraction
Without getting into too much technical terms, we’ll just see how we actually do it else it
will get very messy and we’ll actually get off track of our main goal which is solving the Pell’s
Equation. Let’s see this with an example. We have,
√
[ 23] = 4
11
Diophantine Equation Aayush Kumar
⇒
√ 1
23 = 4 +
√ 1
23−4
√ x
Now that we have got the approximate expression for 23 we can compare this with y.
Suppose, we assume
1
≈0
3 + 1+ 1 1
8+....
then we get
x √ 1
= 23 = 4 + =5
y 1+0
so, we get x = 5, y = 1 now let’s see if this pair satisfies our equation
x2 − 23y 2 = 1
25 − 23 = 2
which clearly doesn’t work. So, let’s try for a better approximation by taking
1
≈0
8 + ....
12
Diophantine Equation Aayush Kumar
then we get
x 1 4 24
=4+ =4+ =
y 1 + 3+1 1 5 5
1+0
242 − 23 ∗ 52 = 1
So, finally we get a pair which indeed works for the equation x2 − 23y 2 = 1. But, to actually
solve x2 − 92y 2 = 1, we wanted y to be even, but unfortunately for us, y = 5. But, we really
equation x2 −23y 2 = 1 since√we
shouldn’t be disappointed as we can find other solutions to the √
already have the fundamental solution. So, since z = 24+5 23 works, z 2 = 1151+240 23
also works. So, we get another solution as x = 1151, y = 240 and indeed, y is even. So, we
have
11512 − 92 ∗ 1202 = 1
Hence, we finally get a solution as x = 1151, y = 120 to the equation x2 − 92y 2 = 1. ■
Exercise
√
(Kurshak Competition) Q: Prove that if m = 2 + 2 28n2 + 1 is an integer for some
n ∈ N then m is a perfect square.
We can solve this recursive relation to get a explicit form for xn−1 and yn−1 . Upon solving
we’ll get
√ n √ n √ n √ n
1 1
xn−1 = (x0 + y0 D) + (x0 − y0 D) , yn−1 = √ (x0 + y0 D) − (x0 − y0 D)
2 2 D
2
2. Find all pairs (a, b) of positive integers that satisfy the equation ab = ba .
3. (Romanian Mathematical Olympiad). Prove that there are infinitely many quadru-
ples (x, y, z, t) of positive integers with no common divisors such that
x3 + y 3 + +z 2 = t4
13
Diophantine Equation Aayush Kumar
4. (IMO Shortlist 2019 N2). Find all triples (a, b, c) of positive integers such that
2
a3 + b3 + c3 = (abc) .
5. Prove that 1919 cannot be written as a sum of a perf ect cube and a perf ect f ourth power.
6. (China TST 3 2018). Find all pairs of positive integers (x, y) such that (xy + 1)(xy +
x + y + 2) is a perfect square.
7. (IMO Shortlist 1991, P17). Find all positive integers (x, y, z) satisfying the equation
3x + 4y = 5z
14