Pell's Equation is presented within the context of solving Fermat's Last Theorem: n=5. For those interested in the history of Fermat's Last Theorem: n=5, start here. For those interested in the proof itself, start here.

Today's blog is again based on Harold M. Stark's An Introduction to Number Theory.

Method for Solving Pell's Equation of the form: x

^{2}- dy

^{2}= 1 where x,y are integers.

(1) Use Continued Fractions to identify the the period for the quadratic integer √d (see here for details on the method for doing this). We will need to know at what point the period starts and its length.

For example, let's look at √3

√3 = [ 1, 1, 2 ]

The period starts at n=1 and it has a length of 2.

(2) Use Matrix Theory and Continued Fractions to find M

_{n}

^{-1}(see here for more details)

In the case of √3:

(3) Use Matrix Theory and Continued Fractions to find M

_{kn+p}

where k is any positive integer. For the example, I will use k = 1.

In the case of √3 (see here for details on how q

_{n}and p

_{n}are defined):

(4) Now, to find the solution, get the product of M

_{n}

^{-1}with M

_{n+p}.

In the case of √3 (see here for a review of matrix products):

(5) Then, we find the answer in the result where x,y are found here:

x = a

y = c

In this case of √3 :

x=2, y=1

And we see that:

(2)

^{2}- 3(1)

^{2}= 4 - 3 = 1

NOTE: Setting a=2, 3, 4 etc. gives us:

a=2: x=7, y = 4

a=3: x=26, y = 15

a=4: x=97, y=56

QED

Finally, here is a lemma about this method:

Lemma 1: The above method solves Pell's Equation (Sufficiency)

In other words:

(a) We let r

_{k}, s

_{k}, t

_{k}, u

_{k}be the result of M

_{n}

^{-1}M

_{n+kj}:

(b) We define M

_{n}based on the Continued Fraction Approximation Algorithm so that:

(c) We further assume that:

n = the start of the period for √d and j is the length of the period such that:

√d = [ a

_{0}, a

_{1}, ... a

_{n-1}, α

_{n}]

and

α

_{n}= [ a

_{0}, ... a

_{j-1}, α

_{n}]

(d) k is any positive integer.

Then

r

_{k}

^{2}- dt

_{k}

^{2}= (-1)

^{n}

Proof:

(1) Let γ

_{n}= α

_{n}q

_{n-1}+ q

_{n-2}. [See here for definition of α

_{n}and q

_{n}]

(2) We know that γ

_{n}≠ 0. [See here for proof]

(3) Let λ = γ

_{n+j}/γ

_{n}. [We can do this since γ

_{n}≠ 0]

(4) We note that δ(1,√d) = (1,√d)M

_{n}

^{-1}M

_{n+kj}

[See here for proof]

(5) From this, we can know that:

(dt

_{k}- s

_{k}) + (r

_{k}- u

_{k})√d = 0. [See here for proof ]

(6) From a basic property of irrational numbers (see here), we know that:

dt

_{k}- s

_{k}= 0

r

_{k}- u

_{k}= 0

Therefore, we have:

u

_{k}= r

_{k}

s

_{k}= dt

_{k}

(7) Appyling this to (a) above gives us:

(8) From this, we know that:

(9) Now using the fundamentals of determinants (see here) and some lemmas found here, we know that:

det (M

_{n}

^{-1}M

_{n+kj}) = det(M

_{n}

^{-1})det(M

_{n+kj}) =

det (M

_{n})

^{-1}det (M

_{n+kj})=

[(-1)

^{n}]

^{-1}(-1)

^{n+kj}=

(-1)

^{-n}(-1)

^{n+kj}= (-1)

^{kj}

(10) Likewise, we know that:

(11) So putting this together, we have show that:

r

_{k}

^{2}- dt

_{k}

^{2}= (-1)

^{kj}

QED

Corollary 1.1: There are either an infinite number of solutions to Pell's equation or no solutions. (Existence).

(1) We know that:

det(M

_{n}

^{-1}M

_{n+kj}) = (-1)

^{kj}[From Lemma 1]

(2) There are infinitely many values of k involves since k is any positive integer.

(3) When j is even, (-1)

^{kj}= 1 for all k.

(4) If j is odd, (-1)

^{kj}= 1 for all even k and (-1)

^{kj}= -1 for all odd k.

(5) Different values of k give different pairs of numbers r

_{k}and t

_{k}

(a) Suppose r

_{k}= r

_{m}, t

_{k}= t

_{m}

(b) M

_{n}

^{-1}M

_{n+kj}= M

_{n}

^{-1}M

_{n+mj}

(c) M

_{n+kj}= M

_{n}(M

_{n}

^{-1}M

_{n+kj}) = M

_{b}(M

_{n}

^{-1}M

_{n+mj}) = M

_{n+mj}

(d) Thus n+kj = n + mj and k = m (see here for proof)

(e) Therefore, k ≠ m → r

_{k}≠ r

_{m}or t

_{k}≠ t

_{m}

QED