Pell
Pell
x2 − Ay 2 = 1 (1)
1
√
Proof. Let us denote ū = p − q A, then the formula (5) can be written as uū = N (u).
Thus we have
ū √
u−1 = = ū ∈ Z( A).
N (u)
(Note the analogy with the complex numbers!) Formulae (5) and (6) also imply a very
important formula
N (uv) = N (u)N (v). (7)
Indeed, we have N (uv) = uvuv = uvūv̄ = uūvv̄ = N (u)N (v).
It is time now to relate these properties of the new function N (x) to the solutions of
(1) and also to the solutions of the equation
x2 − Ay 2 = k, k ∈ Z. (8)
Proposition 2. A pair of integers (x, y) is a solution to Pell’s equation (8) if and only if
√
N (u) = k for u = x + y A. In particular, a pair of integers (x, y) is a solution to Pell’s
equation (1) if and only if N (u) = 1.
Theorem 1. Suppose that a pair of integers (a, b) is a solution to Pell’s equation (1) and
√
(x, y) is an arbitrary solution to the Diophantine equation (8). Let us denote u = x+y A,
√
v = a + b A, and
√ √
uv = (xa + ybA) + (xb + ya) A = x′ + y ′ A, (9)
where x′ = xa + ybA and y ′ = xb + ya. Then this pair of integers (x′ , y ′ ) is also a solution
to the equation (8).
Proof. This follows from the multiplicative property of the norm. Indeed, N (uv) =
N (u)N (v) = 1 · k = k.
This theorem gives us a very important tool to obtain a number of solutions of (8) if we
know at least one solution of (1) different from the trivial solution (1, 0). We reformulate
Theorem 1 now in terms of geometric transformations of the plane.
2
Theorem 2. Suppose that a pair of integers (a, b) is a solution to Pell’s equation (1).
Let us consider a linear transformation of the plane (x, y) → (x′ , y ′ ), where
x′ = ax + bAy,
y ′ = bx + ay.
Then this transformation maps the solutions of (8) again onto the solutions of (8).
It is clear now why the solution (1, 0) of (1) is called trivial. It is because of the fact
that the corresponding linear transformation for a = 1 and b = 0 is simply the identity
transformation.
x2 − 2y 2 = 1. (10)
It has a nontrivial solution (x, y) = (3, 2). Then the following linear transformation
x′ = 3x + 4y,
y ′ = 2x + 3y
x2 − 2y 2 = 7
It is clear now that it is important to prove that the equation (1) always has a nontrivial
solution for every positive integer A which is not the square of a whole number. We shall
start proving this with the following
Lemma 1. Let α be an irrational number. Then for every positive integer t the inequality
p 1
α− < . (11)
q tq
has an integer solution (p, q) such that 1 ≤ q ≤ t.
3
Proof. Let [γ] be the integer part and {γ} be the fractional part of a real number γ, i.e.,
√ √ √
[γ] ∈ Z and 0 ≤ {γ} < 1. (For example, 23 = 1, { 32 } = 21 , and 5 = 2, { 5} = 5−2.)
It is always true that γ = [γ] + {γ}.
Let us divide the unit interval [0, 1) (where 0 is included and 1 is not) into t intervals
1 1 2 t−1
0, , , , ... , ,1 (12)
t t t t
of equal length 1/t. Let us consider t + 1 numbers {αk}, k = 1, 2, . . . , t + 1. By Pigeonhole
Principle at least two of them, say {αk1 } and {αk2 }, will be situated in the same interval
of the partition (12) of the unit interval. Thus
1
|{αk1 } − {αk2 }| < .
t
Replacing here {αki } by αki − [αki ] we get
1
|αk1 − [αk1 ] − (αk2 − [αk2 ])| < .
t
or |qα − p| < 1t , where q = k1 − k2 and p = [αk1 ] − [αk2 ]. Dividing by q we get (11). It is
clear that q ≤ (t + 1) − 1 = t.
Proof. As
p 1 1
α− < ≤ 2
q tq q
we see that every solution to (11) is also a solution to (13). It is also clear that as t grows
more and more new solutions of (13) will emerge.
√
Lemma 2. For some integer k such that |k| < 2 A + 1 the equation
x2 − Ay 2 = k
4
Therefore |p2 − Aq 2 | can take only finitely many integer values k satisfying
√ √
−(2 A + 1) < k < 2 A + 1.
As the inequality (13) has infinitely many solutions by Pigeonhole Principle for some k
in this range the equation x2 − Ay 2 = k also has infinitely many integer solutions.
Lemma 3. There exist a nonzero integer k and two positive integers 0 ≤ a, b < |k| such
that the equation (8) has infinitely many integer solutions (x, y) such that x ≡ a (mod |k|)
and y ≡ b (mod |k|).
Proof. Let k be such that the equation (8) has an infinite number of solutions. Such k
exists according to Lemma 2. We assume that k 6= −1 and we consider this case later.
We need Pigeonhole Principle again. For an arbitrary solution (x, y) of (8) we have
x ≡ i (mod |k|) and y ≡ j (mod |k|) for some 0 ≤ i, j ≤ |k|. As we have k possibilities
for i and k possibilities for j, in total, we have k 2 possibilities for the pair (i, j). Again
we have a finite number of boxes and infinite number of solutions to (8) to go into them.
Therefore there will be an infinite number of solutions at least in one of them.
Theorem 3. For every positive integer A which is not the square of a whole number Pell’s
equation (1) has a nontrivial integer solution (a, b) 6= (1, 0).
Proof. The idea of constructing a solution to Pell’s equation is as follows. Let (x1 , y1 )
√
and (x2 , y2 ) be two distinct solutions to (8). This means that for u1 = x1 + y1 A and
√
u2 = x2 + y2 A we have N (u1 ) = N (u2 ) = k. Since N (u1 u−12 ) = N (u1 )N (u2 )
−1
= 1, the
−1
√
idea is to consider v = u1 u2 = a + b A. Then N (v) = 1, hence (a, b) is a solution of (1).
We now have to take care of two things: to secure that a and b are integers and to check
that this solution is nontrivial. To deal with the first problem let us calculate a and b:
√
√ x2 − y2 A (x1 x2 − Ay1 y2 ) (x1 y2 − x2 y1 ) √
v = x1 + y1 A = + A,
k k k
whence
(x1 x2 − Ay1 y2 ) (x1 y2 − x2 y1 )
a= , b= . (14)
k k
Let (x1 , y1 ) and (x2 , y2 ) be two distinct solutions to (8) such that
5
and
x1 y2 − x2 y1 ≡ x1 y1 − x1 y1 ≡ 0 (mod |k|).
Exercise 1. Let k 6= 1 be an integer and A be a positive integer which is not the square
of a whole number. Suppose that the equation (8) has at least one solution. Then it has
infinitely many solutions.
We can say much more about the solutions to Pell’s equation. We need the following
comment.
√
Lemma 4. Let (x, y) be an integer solution to Pell’s equation (1) and u = x + y A.
Definition 1. Let (a, b) be a nontrivial solution to Pell’s equation (1) with positive integer
components a > 0, b > 0. We say that this solution is fundamental if the number u =
√
a + b A takes the minimal possible value.
√ √
Note that the number u is uniquely determined since a + b A = a′ + b′ A implies
√ √
(b − b′ ) A = a′ − a and A is rational unless b = b′ and a = a′ . Let us also note that
u > 1 by Lemma 4.
Theorem 4. Let (x1 , y1 ) be the fundamental solution to Pell’s equation (1) and u =
√
x1 + y1 A. Let
√
un = xn + yn A, n = 0, 1, 2, . . . (15)
6
Proof. The trivial solution (1, 0) is in this set and we get it for n = 0. Let (x, y) be
an arbitrary nontrivial solution to Pell’s equation. We may assume that x > 0. Since
√ √
(x + y A)−1 = x − y A, we may also assume that y > 0. All we need to show is that
√
v = x + y A can be represented as un for some positive integer n. Let us assume the
contrary. As x > 0 and y > 0, we know that v > 1. Since u > 1 the terms of the sequence
1, u, u2 , . . ., un , . . . get arbitrary large, thus there exists n such that un < v < un+1 . Let
us multilply this inequality by (un )−1 . We get
Exercise 2. Suppose that a pair of integers (x1 , y1 ), x1 > 0, y1 > 0, is a solution to Pell’s
equation x2 − Ay 2 = 1. Then this solution is fundamental if and only if y1 is minimal
among all integers solutions with positive components.
This Exercise gives us an algorithm how to find the minimal solution. We have to try
subsequently y1 = 1, 2, . . . until a matching x1 is found. This algorithm is not an efficient
one. For example, for the equation x2 − 109y 2 = 1 the minimal solution (x1 , y1 ) will have
y1 = 15140424455100. A better algorithm is beyond the scope of this lecture.