Arya Tex
Arya Tex
1.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
2 Diophantine Equations 23
2.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
1
2.4 General Solution of ax − by = c, gcd(a, b) = 1 . . . . . . . . . . 34
3.2 Convergents . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
Contents
1
Chapter 1
1.1 Introduction
Or by some other method we can divide through by x and can write the
equation in the form
1
x=3+ .
x
The unknown quantity x is still found on the right-hand side of this equation
and hence can be replaced by its equal, namely 3 + x1 . This gives
1 1
x=3+ =3+ .
x 1
3+
x
2
1
Repeating this replacement of x by 3 + x
several more times we obtain the
expression
1
x=3+ . (1.1)
1
3+
1
3+
1
3+
1
3+
x
Since x continues to appear on the right-hand side of this “multiple decked”
fraction, we do not seem to be getting any closer approximation to the solu-
tion of our quadratic equation.
But let us look more closely at the right side of equation (1.1). We see that
it contains a succession of fractions,
1 1 1
3, 3+ , 3+ , 3+ ,..., (1.2)
3 1 1
3+ 3+
3 1
3+
3
10 33 109
3, = 3.333 . . . , = 3.3, = 3.30303 . . .
3 10 33
This gives a better approximation to the positive root of the quadratic equa-
tion, i.e., 3.302775 . . .
If we calculate more and more successive fractions (1.2), we can get better
√
and better approximation to x = 12 (3 + 13.) Also we can continue these
fractions infinitely, non terminating like
1
x=3+
1
3+
3 + ..
..
3
These multiple decked fractions are called Continued Fractions.
b1
a1 +
b2
a2 +
b3
a3 +
a4 + . .
..
1
a1 + ,
1
a2 +
1
a3 +
a4 + . .
..
where the first term a1 is usually a positive or negative integer (but could be
zero), and where the terms a2 , a3 , a4 , . . . are positive integers.
Fractions of the form
1
a1 + ,
1
a2 +
1
a3 +
a4 + . . 1
. .+
1
an−1 +
an
4
are called finite simple continued fractions. A much more convenient way of
writing this is by the symbol [a1 , a2 , a3 , . . . , an ], so that
1
[a1 , a2 , a3 , a4 , . . . , an ] = a1 + .
1
a2 +
1
a3 +
a4 + . . 1
. .+
1
an−1 +
an
The terms a1 , a2 , . . . , an are called the partial quotients of the continued frac-
tion.
p
A rational number is a fraction of the form q
where p and q are integers with
q 6= 0. We shall see that every rational number can be expressed as a finite
simple continued fraction.
67
Example 1.3.1. The continued fraction for 29
is
67 1
=2+
29 1
3+
1
4+
2
or
67
= [2, 3, 4, 2]
29
To get this result first we divided 67 by 29 to obtain the quotient 2 and the
remainder 9, so that
67 9 1
=2+ =2+
29 29 29
9
5
9 29
Note that on the right we have replaced 29
by the reciprocal of 9
.
Next divide 29 by 9 to obtain
29 2 1
=3+ =3+ .
9 9 9
2
9 1
=4+ ,
2 2
at which stage the process terminates. Now by combining all these expression
67 1 1 1
=2+ =2+ =2+
29 29 1 1
3+ 3+
9 9 1
4+
2 2
Or
67
= [2, 3, 4, 2] = [a1 , a2 , a3 , a4 ]
29
29
Example 1.3.2. Let us find the continued fraction expansion for 67
. We
obtain
29 1
=0+
67 1
2+
1
3+
1
4+
2
To get this result,
29 1
=0+
67 67
29
67
And by substituting the continued fraction expansion of 29
in the above, we
29
will have the expansion for 67
.
6
A comparison of these two above expansions suggests that in a fraction
p
q
,if p is greater than q and
p
= [a1 , a2 , . . . , an ]
q
then
q
= [0, a1 , a2 , . . . , an ]
p
If p is less than q and
q
= [a1 , a2 , . . . , an ]
p
then
p
= [0, a1 , a2 , . . . , an ]
q
67 67
But 29
= [2, 3, 4, 2] = [a1 , a2 , a3 , a4 ] is not only the expansion of 29
.This
would be true with a slight change in the last term, or last partial quotient,
a4 . Since a4 = 2, we can write
1 1 1
= =
a4 2 1
1+
1
67
= [2, 3, 4, 1, 1]
29
−37
Example 1.3.3. To find the continued fraction expansion of 44
,
−37 7 1 1 1 1
= −1+ = −1+ = −1+ = −1+ = −1+ = [−1, 6, 3, 2]
44 44 44 2 1 1
6+ 6+ 6+
7 7 7 1
3+
2 2
7
1 1
or by replacing with , we can get the continued fraction expansion of
2 1
1+
1
−37
44
= [−1, 6, 3, 1, 1] = [a1 , a2 , a3 , a4 , a5 ]. Here only a1 is negative.
134
Example 1.3.4. Continued fraction expansion of 58
134 1 1 1 1
=2+ =2+ =2+ =2+ = [2, 3, 4, 2]
58 58 4 1 1
3+ 3+ 3+
18 18 2 1
4+ 4+
4 2
134 67×2
The continued fraction expansion of 58
= 29×2
is same as the expansion
67
of 29
.
ap
In general, continued fraction expansion of aq
is equal to the continued frac-
tion expansion of pq . This also illustrates an interesting property.If we calcu-
late
1
[2, 3, 4, 2] = 2 +
1
3+
1
4+
2
67 134 p
we would get back to 29
not to 58
. We always obtain a rational fraction q
in its lowest terms, i.e., a fraction for which p and q have no factors greater
than 1 in common.
8
Proof. One way of the theorem is obvious from what we have explained in
our worked examples, for if any expansion terminates we can always “back
track” and build the expansion into a rational fraction.
To prove the converse, let pq , q > 0, be any rational fraction. We divide p by
q to obtain
p r1
= a1 + , 0 ≤ r1 < q,
q q
where a1 is the unique integer so chosen as to make the remainder r1 greater
than or equal to 0 and less than q. As we saw in the worked examples, a1
can be negative, zero, or positive. If r1 = 0, the process terminates and the
p
continued fraction expansion for q
is [a1 ].
If r1 6= 0, we write
p 1
= a1 + q , 0 < r1 < q,
q
r1
and repeat the division process, dividing q by r1 to obtain
q r2
= a2 + 0 ≤ r2 < r1 .
r1 r1
q
Notice now that r1
is a positive fraction, so a2 is the unique largest positive
integer that makes the remainder r2 a number between 0 and r1 . If r2 = 0,
q
the process stops and we substitute r1
= a2 to obtain
p 1
= a1 + = [a1 , a2 ]
q a2
9
r1
and repeat the division process using . We observe that the calculations
r2
stop when we come to a remainder rn = 0.
It is possible to arrive at an rn , which is zero, so that the division process
continues indefinitely. For the remainders r1 , r2 , r3 , . . . form a decreasing
sequence of non-negative integers q > r1 > r2 > r3 > . . . and unless we
come eventually to a remainder rn which is equal to zero, we shall be in
the ridiculous position of having discovered an infinite number of distinct
positive integers all less than a finite positive integer q.
Hence, by successive divisions we obtain a sequence of equation
p r1
= a1 + , 0 < r1 < q,
q q
q r2
= a2 + , 0 < r2 < r1 ,
r1 r1
r1 r3
= a3 + , 0 < r3 < r2 ,
r2 r2 (1.3)
......... ......
rn−3 rn−1
= an−1 + , 0 < rn−1 < r−2 ,
rn−2 rn−2
rn−2 0
= an + = an + 0, rn = 0,
rn−1 rn−1
p 1 1
= a1 + q = a1 +
q 1
r1 a2 + r1
r2
10
r1
Using the third equation in (1.3) we replace r2
by
1
a3 + r2 ,
r3
p
= [a1 , a2 , a3 , . . . , an ]. (1.4)
q
The uniqueness of the expansion (1.4) follows from the manner in which the
ai ’s are calculated. This statement must be accompanied, however, by the
remark that once the expansion has been obtained we can always modify the
last term an so that the number of terms in the expansion is either even or
odd, as we choose. To see this, notice that if an is greater than 1 we can
write
1 1
=
an 1
(an − 1 + )
1
so that (1.4) can be replaced by
p
= [a1 ,2 , . . . , an−1 , an − 1, 1].
q
1 1
= ,
1 (an−1 + 1)
an−1 +
an
p
= [a1 , a2 , . . . , an−2 , an−1 + 1]
q
11
p
Theorem 1.4.2. Any rational number q
can be expressed as a finite simple
continued fraction in which the last term can be modified so as to make the
number of terms in the expansion either even or odd.
29
Example 1.4.1. Continued fraction expansion of 5
29 4 1 1
=5+ =5+ =5+ = [5, 1, 4]
5 5 5 1
1+
4 4
1 1
The last term can be replaced by
4 1
3+
1
29 1
Then =5+ = [5, 1, 3, 1]
5 1
1+
1
3+
1
−29
Example 1.4.2. Continued fraction expansion of 5
−29 1
= −6 + = [−6, 5]
5 5
or
−29 1 1
= −6 + = −6 + = [−6, 4, 1]
5 5 1
4+
1
12
1.5 Convergents and Their Properties
From the partial quotients of continued fractions, we can form the fractions
a1 1 1
c1 = , c 2 = a1 + , c 3 = a1 + ,...
1 a2 1
a2 +
a3
They are obtained in succession, by cutting off the expansion process after
the first, second, third,... steps. These fractions are called first, second,
third,... convergents of the continued fractions respectively.
Where nth convergent is giben by
1
c n = a1 +
1
a2 +
1
a3 +
a4 + . . 1
. .+
1
an−1 +
an
13
To compute these convergents, we write
p1
c1 =a1 = ,
q1
p 1 = a1 , q 1 = 1
1 a1 a2 + 1 p2
c2 =a1 + = = ,
a2 a2 q2
p2 = a1 a2 + 1, q2 = a2
1 a3 a1 a2 a3 + a1 + a3
c3 =a1 + = a1 + =
1 a2 a3 + 1 a2 a3 + 1
a2 +
a3
a3 (a1 a2 + 1) + a1 a3 p 2 + p 1 p3
= = = ,
a3 a2 + 1 a3 q 2 + q 1 q3
p 3 = a3 p 2 + p 1 , q 3 = a3 q 2 + q 1
1 1 a3 a4 + 1
c4 =a1 + = a1 + a4 = a1 +
1 a2 + a2 a3 a4 + a2 + a4
a2 + a3 a4 + 1
1
a3 +
a4
a1 a2 a3 a4 + a1 a2 + a1 a4 + a3 a4 + 1
=
a2 a3 a4 + a2 + a4
a4 (a1 a2 a3 + a1 + a3 ) + a1 a2 + 1 a4 p 3 + p 3 p4
= = = ,
a4 (a2 a3 + 1) + a2 a4 q 3 + q 2 q4
p 4 = a4 p 3 + p 2 , q 4 = a4 q 3 + q 2
pi
In general ci = [a1 , a2 , . . . , ai ] = qi
and
Theorem 1.5.1. The numerators pi and the denominators qi of the ith con-
vergent ci of the continued fraction [a1 , a2 , . . . , an ] satisfy the equations
14
with the initial values
p1 = a1 , p2 = a2 a1 + 1, q1 = 1, q2 = a2 .
Also
1
cn−1 = a1 +
1
a2 +
a3 + . . 1
. .+
1
an−2 +
an−1
and
1
c n = a1 +
1
a2 +
a3 + . . 1
. .+
1
an−1 +
an
We obtain cn from cn−1 by replacing the last term an−1 of cn−1 by an−1 +
1
an
, while leaving a1 , a2 , a3 , . . . , an−2 unaltered. Hence if we replace an−1 by
15
1
an−1 + an
in (1.5), we will obtain
1
(an−1 + )pn−2 + pn3
an
cn =
1
(an−1 + )qn−2 + qn−3
an
pn−2
pn−2 an−1 + + pn−3
an
= qn−2
qn−2 an−1 + + qn−3
an
pn−2
pn−1 +
an an pn−1 + pn−2
= qn−2 = a q
qn−1 + n n−1 + qn−2
an
pn
=
qn
p1 = a1 , p2 = a2 a1 + 1, q1 = 1, q2 = a2 .
120
Example 1.5.1. Convergents of 49
.
120
The continued fraction expansion of 49
is [2, 2, 4, 2, 2].
i.e., a1 = 2, a2 = 2, a3 = 4, a4 = 2, a5 = 2.
Then
p1 = a1 = 2, q1 = 1
p2 = a1 a2 + 1 = 2 × 2 + 1 = 5, q2 = a2 = 2
p3 = a3 p2 + p1 = 4 × 5 + 2 = 22, q3 = a3 q2 + q1 = 4 × 2 + 1 = 9
p4 = a4 p3 + p2 = 2 × 22 + 5 = 49, q4 = a4 q3 + q2 = 2 × 9 + 2 = 20
p5 = a5 p4 + p3 = 2 × 49 + 22 = 120, q5 = a5 q4 + q3 = 2 × 20 + 9 = 49.
16
Then the convergents are
c1 = 2, c2 = 52 , c3 = 22
9
, c4 = 49
20
, c5 = 120
49
pn
Theorem 1.5.2. The convergent cn = qn
satisfy the relation
Proof.
pn qn−1 − pn−1 qn = (an pn−1 + pn−2 )qn−2 − pn−1 (an qn−1 + qn−2 )
= −an−1 pn−2 qn−2 − pn−3 qn−2 + pn−2 qn−1 qn−2 + pn−2 qn−3
Then
tn = (−1)1 tn−1 = (−1)2 tn−2 = · · · = (−1)n−2 t2
t2 = p2 q1 − p1 q2 = (a1 a2 + 1) − a1 a2 = 1
17
Solve in positive integers.
100x + 90
=y
63
or
100x − 63y = −90
100
The continued fraction expansion for 63
is
100
= [1, 1, 1, 2, 2, 1, 3]
63
i.e., a1 = 1, a2 = 1, a3 = 1, a4 = 2, a5 = 2, a6 = 1, a7 = 3.
Then
p1 = a1 = 1, q1 = 1
p2 = a1 a2 + 1 = 2, q2 = a2 = 1
p3 = a3 p2 + p1 = 3, q3 = a3 q2 + q1 = 2
p4 = a4 p3 + p2 = 8, q4 = a4 q3 + q2 = 5
p5 = a5 p4 + p3 = 19, q5 = a5 q4 + q3 = 12
p6 = a6 p5 + p4 = 27, q6 = a6 q5 + q4 = 17
p7 = a7 p6 + p5 = 100, q7 = a7 q6 + q5 = 63.
100 × 17 − 63 × 27 = (−1)7 = −1
100x0 − 63y0 = −1
18
Multiplying throughout the equation by 90,
pi
corollary 1.5.1. Every convergent ci = qi
, i > 1 of a simple continued
fraction is in its lowest terms. i.e., gcd(pi , qi ) = 1.
Proof. By 1.5.2, pi qi−1 − pi−1 qi = (−1)i , i > 1 Since this equation is a linear
combination of pi and qi , any number which divides both of them must divide
(−1)i . But the only divisor of (−1)i is 1 and −1.i.e., ±1 are the only common
divisors of pi and qi .
∴ gcd(pi , qi ) = 1.
The earliest traces of the idea of a continued fraction are somewhat confused,
for many ancient arithmetical results are suggestive of these fractions, but
there was no systematic development of the subject.
19
Euclid’s method for finding the gcd of two numbers is essentially that of con-
verting a fraction into a continued fraction. This is perhaps the earliest (300
B.c.) important step in the development of the concept of a continued frac-
tion. A reference to continued fractions is found in the works of the Indian
mathematician Aryabhata, who died around 550 A.D. His work contains one
of the earliest attempts at the general solution of a linear indeterminate equa-
tion by the use of continued fractions. Further traces of the general concept
of a continued fraction are found occasionally in Arab and Greek writings.
Most authorities agree that the modern theory of continued fractions began
with the writings of Rafael Bombelli, a native of Bologna. His treatise on
algebra (1572) contains a chapter on square roots. In our modern symbolism
he showed, for example, that
√ √ √ 4
13 = 9 + 4 = 32 + 4 = 3 +
4
6+
6 + ..
..
This indicates that
√ b
a2 + b = a +
b
2a +
2a + . .
..
The next writer to consider these fractions was Pietro Antonio Cataldi (1548-
1626), also a native of Bologna. In a treatise on the theory of roots (1613),
√
he expressed 18 in the form
2 2 2
4& & & . . .
8 8 8
20
√ √ √ 2
18 = 16 + 2 = 42 + 2 = 4 +
2
8+
8 + ..
..
A third early writer who deserves mention is Daniel Schwenter (1585-1636),
who was at various times professor of Hebrew, Oriental languages, and math-
ematics at the University of Altdorf, Germany. In his book Geometrica
177
Practica he found approximations to 233
by finding the gcd of 177 and 233,
79
and from these calculations he determined the convergents , 19 , 3 , 1 , 0 .
104 25 4 1 1
177
= [0, 1, 3, 6, 4, 2] and
233
c1 = 0,
1
c2 = 0 + 1
=1
1 3
c3 = 0 + 1 =4
1+
3
1 19
c4 = 0 + =
1 25
1+
1
3+
6
1 79
c5 = 0 + = .
1 104
1+
1
3+
1
6+
4
In the discussion of Brouncker’s fraction in his book Arithmetica Injinitorum,
published in 1655, Wallis stated a good many of the elementary properties
of the convergents to general continued fractions, including the rule for their
formation. He also used for the first time the name “continued fraction”.
Continued fractions play an important role in present day mathematics. They
constitute a most important tool for new discoveries in the theory of numbers
and in the field of Diophantine approximations.
21
Chapter 2
Diophantine Equations
2.1 Introduction
which is equivalent to
8x + 5y = 81 (2.1)
22
If nothing limits the values of x and y in equation (2.1), we can give x any
1
value, say 2
, and then solve the resulting equation
4 + 5y = 81
77
for y, getting y = 5
. In this sense, (2.1) is an indeterminate equation, which
means that we can always find some value of y corresponding to any value
we choose for x.
If, however, we restrict the values of x and y to be integers, as the farmer
is likely to do (since he is probably not interested in half a cow), then our
example belongs to an extensive class of problems requiring that we search
for integral solutions x and y of indeterminate equations. Indeterminate
equations to be solved in integers (and sometimes in rational numbers) are
often called Diophantine equations in honor of Diophantus, a Greek math-
ematician of about the third century A.D., who wrote a book about such
equations. Our problem, it should be noted, has the further restriction that
both x and y must not only be integers but must be positive.
In fact there is no harm in solving such equations by trial and error or by
making intelligent guesses. For example, if we write equation (2.1) in the
form
81 − 8x = 5y
23
was used extensively by Euler in his popular text Algebra, published in 1770
8x + 5y = 81
Since y has the smaller coefficient, we solve the equation for y, getting
81 − 8x
y=
5
81 = 5 × 16 + 1 and 8=5×1+3
(5 × 16 + 1) − (5 × 1 + 3)x
y=
5
1 − 3x (2.2)
= 16 − x +
5
= 16 − x + t
where
1 − 3x
t=
5
or
5t + 3x = 1
24
Since x and y must be integers, we conclude from equation (2.2) that t must
be an integer. This is the essential idea in Euler’s method to show that
integral solutions of given equation are in turn connected with the integral
solutions of similar equation with the smaller coefficient.
Now solving the last equation by the above discussed procedure,
5t + 3x =1
1 − 5t
x=
3
1 − (2.3 − 1)t
= (2.3)
3
1+t
= − 2t +
3
= − 2t + u
where
1+t
u=
3
or
3u − t = 1
t = 3u − 1
x = − 2t + u = −2(3u − 1) + u
= − 6u + u + 2 = 2 − 5u
and (2.4)
=16 − 2 + 5u + 3u − 1 = 8u + 13
25
∴ x = 2 − 5u and y = 13 + 8u, u∈Z
16 − 40u + 65 + 10u = 81
which means this eqaution has infinite number of solutions, one for each
integral value of u. A few solutions are listed below
u -3 -2 -1 0 1 2 3
x 17 12 7 2 -3 -8 -13
y -11 -3 5 13 21 29 37
2 −13
=⇒ u < and u>
5 8
Then the only possible integral values of u are 0 and −1, which leads to the
solutions (x, y) = (2,13) and (7,5).
Example 2.2.1. Use Euler’s method to solve the linear Diophantine equa-
tions, 31x + 7y = 1. And list the positive integral solutions.
26
31x + 7y =1
1 − 31x
y=
7
1 − (4.7 + 3)x
=
7
1 − 3x
= − 4x
7
=t − 4x
where
1 − 3x
t=
7
or
7t + 3x = 1
Then
1 − 7t
x=
3
1 − (2.3 + 1)t
=
3
1−t
= − 2t
3
=u − 2t
where
1−t
u= , u∈Z
3
or
t = 1 − 3u
27
Now,
x = − 2t + u = −2(1 − 3u) + u
=6u + u − 2 = 7u − 2
and (2.5)
y =t − 4x = 1 − 3u − 4(7u − 2)
=1 − 3u − 28u + 8 = 9 − 31u
217u − 62 + 63 − 217u = 1
which means this eqaution has infinite number of solutions, one for each
integral value of u. If the problem is such that we are limited to positive
values of x and y, then two inequalities must be solved,
28
2.3 The Indeterminate Equation ax−by = ±1
a
Proof. We first convert b
into a finite simple continued fraction
a
= [a1 , a2 , . . . , an−1 , an ]
b
where ai ’s are the partial quotients of simple finite continued fraction ab . Let
c1 , c2 , . . . , cn−1 , cn are its convergents. Then
pn−1 pn a
cn−1 = and cn = =
qn−1 qn b
Case(i): n is even.
Then
aqn−1 − pn−1 b = 1
Comparing this with the given equation, ax−by = 1, we will get one solution
x0 = qn−1 , y0 = pn−1 ,
29
which is a particular solution.
Case(ii): n is odd.
a
We can rewrite b
= [a1 , a2 , . . . , an−1 , an ] as
[a1 , a2 , . . . , an−1 − 1, 1], if an > 1
In both cases the number of partial quotients is even. So now we can recal-
pn−1 pn
culate qn−1
and qn
, so that again we will get aqn−1 − pn−1 b = 1, which will
yield a particular solution.
Now to find general solution,
let (x, y) be any other solution, then ax − by = 1 and ax0 − by0 = 1
a(x − x0 ) = b(y − y0 )
This shows that b divides the left side of the equation. But b cannot divide
a since a and b are relatively prime; hence b must divide (x − x0 ), that is,
(x − x0 ) is an integral multiple of b, and we may write
x − x0 = tb, t∈Z
or
x = x0 + tb, t∈Z
Then
a(tb) = b(y − y0 )
so that
y − y0 = ta
30
It follows that any other solution (x, y) of ax − by = 1 has the form
=ax0 − by0 = 1
Since 205 and 93 are relatively prime, by theorem 2.3.1 this equation
has solutions.
205
Continued fraction expansion of is [2, 4, 1, 8, 1, 1]
93
Here n = 6
i 1 2 3 4 5 6
ai 2 4 1 8 1 1
pi 2 9 11 97 108 205
qi 1 4 5 44 49 93
31
Then the particular solution of 205x − 93y = 1 is (x0 , y0 ) = (49, 108).
And general solution can be given by
Since 205 and 93 are relatively prime, by theorem 2.3.1 this equation
has solutions.
205
Continued fraction expansion of is [2, 4, 1, 8, 1, 1]
93
Since RHS of the equation is −1, we need odd number of partial quotient.
205
Then n = 5 and is [2, 4, 1, 8, 2]
93
i 1 2 3 4 5
ai 2 4 1 8 2
pi 2 9 11 97 205
qi 1 4 5 44 93
32
2.4 General Solution of ax−by = c, gcd(a, b) = 1
Then
a(cx0 ) − b(cy0 ) = ±c
205x − 93y = 5
205(49) − 93(108) = 1
205(5.49) − 93(5.108) = 5
So that (5x0 , 5y0 ) = (245, 540) is a particular solution of the given equation.
Then the general solution, according to 2.8 is given by
33
2.5 General Solution of ax+by = c, gcd(a, b) = 1
a
From the continued fraction expansion of , with an even number of partial
b
quotients, we can get pn−1 and qn−1 . Then
aqn−1 − bpn−1 = 1
This shows that b divides the left side of the equation; but gcd(a, b) = 1, so
b cannot divide a. Therefore b divides cqn−1 − x, so that there is an integer
t such that
cqn−1 − x = bt
or
x = cqn−1 − bt
Then
y = at − cpn−1
34
Since 13 and 17 are relatively prime, this equation has solutions.
13
Continued fraction expansion of 17
= [0, 1, 3, 4] with n = 4
i 1 2 3 4
ai 0 1 3 4
pi 0 1 3 13
qi 1 1 4 9
= 13.1200 − 17.900
35
Example 2.6.1. Solve the equation
410x − 186y = 10
gcd(410, 186) = 2
Since d = 2 divides 10, the equation can be solved. Divide the given equation
by 2 to obtain
205x − 93y = 5
where now 205 and 93 are relatively prime. and then the general solution is
Five sailors were cast away on an island. To provide food, they collected all
the coconuts they could find. During the night one of the sailors awoke and
decided to take his share of the coconuts. He divided the nuts into five equal
piles and discovered that one nut was left over, so he threw this extra one
to the monkeys. He then hid his share and went back to sleep. A little later
a second sailor awoke and had the same idea as the first. He divided the
remainder of the nuts into five equal piles, discovered also that one was left
over, and threw it to the monkeys. Then he hid his share.
In their turn the other three sailors did the same thing, each throwing a
coconut to the monkeys. The next morning the sailors, all looking as innocent
as possible, divided the remaining nuts into five equal piles, no nuts being
36
left over this time. The problem is to find the smallest number of nuts in the
original pile. In order to solve this problem, let x be the original number of
coconuts. The first sailor took 51 (x − 1) coconuts and left 45 (x − 1).
To check this,
x − 1 4(x − 1)
1+ + =x
5 5
Similarly the second sailor took
1 4(x − 1) 4x − 9
−1 =
5 5 5
1 16x − 36 16x − 61
−1 =
5 25 125
and left is
4 16x − 36 64x − 244
−1 =
5 25 125
Similarly coconuts left by the fourth sailor is
Now the number of nuts in the last pile must be a multiple of 5 since it was
divided evenly into five piles with no nuts left over.
37
Hence
1024x − 8404
= 5y
3125
where y is some integer. Multiplying both sides by 3125 we obtain the
indeterminate equation
1024x − 15625y = 1
1024
The continued fraction expansion of is [0, 15, 3, 1, 6, 2, 1, 3, 2, 1].
15625
Here n = 10. The convergents of the continued fraction are calculated:
i 1 2 3 4 5 6 7 8 9 10
ai 0 15 3 1 6 2 1 3 2 1
pi 0 1 3 4 27 58 85 313 711 1024
qi 1 15 46 61 412 885 1297 4776 10849 15625
38
particular solution of equation (2.9). The general solution is
Since both x and y must be positive, we search for the value of t which gives
the smallest positive value of x and which at the same time makes y positive.
From (2.7) we find that t must be an integer satisfying the two inequalities
91174996
t>− = −5835.2 . . . ,
15625
5975244
t>− = −5835.1 . . .
1024
Hence the required value is t = −5835. Introducing this value of t into
equations (2.7), we finally obtain
which means that the original number of coconuts was 3121 and each sailor
received 204 in the final distribution.
39
Chapter 3
Expansion of Irrational
Numbers
So far we seen that a rational number can be expanded into a finite simple
continued fraction and conversely, every finite simple continued fraction rep-
resents a rational number.
An irrational number is one which cannot be√ represented as the ratio of two
√ √ √ 3+ 7
integres. For example 2, − 3, 1 ± 2, ,...
√ 5
P± D
A number of the form , where P, D, Q are integers, and where D is
Q
a positive integer not a perfect square, is irrational. A number of this form
is called a quadratic irrational or quadratic surd since it is the root of the
quadratic equation
Q2 x2 − 2P Qx + (P 2 − D) = 0
There are irrational numbers which are not quadratic surds. The irra-
40
√
tional number π = 3.14159 . . . is one example. The irrational number 2 is
the solution of the algebraic equation x2 − 2 = 0, and is therefore called an
”algebraic number”. An algebraic number is a number x which satisfies an
algebraic equation, i.e., an equation of the form
a0 xn + a1 xn−1 + · · · + an = 0
where a0 , a1 , . . . are integers, not all zero. A number which is not algebraic
is called a transcendental number.
Let x be the given irrational number. Calculate a1 , the greatest integer less
than x, and express x in the form
1 1
x = x 1 = a1 + , 0< <1
x2 x2
1 1
x 2 = a2 + , 0< < 1, a2 ≥ 1
x3 x3
41
where, again, the number
1
x3 = >1
x 2 − a2
is irrational.
This calculation may be repeated indefinitely, producing in succession the
equations
1
x = a1 + , x2 > 1
x2
1
x 2 = a2 + , x3 > 1, a2 ≥ 1
x3
1
x 3 = a3 + , x4 > 1, a3 ≥ 1
x4 (3.1)
...... ... ...
1
x n = an + , xn+1 > 1, an ≥ 1
xn+1
...... ... ...
Substituting x2 from the second equation in (3.1) into the first equation,
then x3 from the third into this result, and so on, produces the required
infinite simple continued fraction.
1 1 1
x = a1 + = a1 + = a1 + = ...
x2 1 1
a2 + a2 +
x3 1
a3 +
x4
42
or
x = [a1 , a2 , a3 , . . . ]
where the three dots indicate that the process is continued indefinitely.
√
Example 3.1.1. Expand 2 into an infinite simple continued fraction.
√
The largest integer less than 2 = 1.414 . . . is a1 = 1, so
√ 1 1
2 = a1 + =1+
x2 x2
1
x2 = 2 +
x3
where
√
1 1 2+1 √
x3 = =√ = √ √ = 2+1>1
x2 − 2 2−1 ( 2 + 1)( 2 − 1)
√ 1 1 1
2 = a1 + =1+ =1+
x2 1 1
2+ 2+ √
x3 2+1
√ √
Since x3 = 2 + 1 is the same as x2 = 2 + 1, the calculations of x4 , x5 , . . .
√
will a11 produce the same result, namely 2 + 1. Thus all the subsequent
43
partial quotients will be equal to 2, gives
√ 1
2=1+
1
2+
1
2+
2 + ..
..
or
√
2 = [1, 2, 2, 2, . . . ] = [1, 2]
√
In a reverse, we can get 2 from the infinite continued fraction [1, 2, 2, 2, . . . ] =
[1, 2].
Let x = [1, 2, 2, 2, . . . ] = [1, 2]
1
i.e., x = 1 +
1
2+
1
2+
2 + ..
..
or
1
x−1=
1
2+
1
2+
2 + ..
..
Then
1
x =1 + !
1
2+
1
2+
2 + ..
..
1
=1 +
2 + (x − 1)
1
=1 +
x+1
44
from which we see that
1
x−1=
x+1
so,
(x − 1)(x + 1) = 1 or x2 = 2
Thus
√
x = [1, 2, 2, 2, . . . ] = [1, 2] = 2
√
Since 53 is between 7 and 8, the largest integer less than x is a1 = 1.
Then
1
x=1+
x2
where √
1 1 53 − 3
x2 = = √ = >1
x−1 25 + 53 2
−1
22
The largest integer less than x2 is a2 = 2, so
1
x2 = 2 +
x3
where √
1 1 53 + 7
x3 = = √ =
x2 − 2 53 − 3 2
−2
2
The largest integer leass than x3 is a3 = 7, so
1
x3 = 7 +
x4
45
where √
1 1 53 + 7
x4 = = √ =
x3 − 7 53 + 7 2
−7
2
Thusx3 = x4 , , and so the last calculation will repeat over and over again.
Hence, the required expansion is
1
x=1+
1
2+
1
7+
7 + ..
..
or
x = [1, 2, 7, 7, . . . ] = [1, 2, 7].
√
25 + 53
Now, in a reverse, we can get from the infinite continued fraction
22
[1, 2, 7, 7, . . . ] = [1, 2, 7].
Let x = [1, 2, 7, 7, . . . ] = [1, 2, 7]
1 1
i.e., x = 1 + =1+
1 1
2+ 2+
1 y
7+
7 + ..
..
where
1 1
y =7+ =7+
1 y
7+
7 + ..
..
Then y satisfies the equation
y 2 − 7y − 1 = 0
46
Solving for y and noting that y > 0, we find that ,
√
7+ 53
y=
2
Hence √
1 1 25 + 53
x=1+ =1+ =
1 2 22
2+ 2+ √
y 7+ 53
which is the original value of x.
3.2 Convergents
√
Example 3.2.1. Calculate the first five convergents of 6.
√
The infinite continued fraction expansion of 6 is given by
[2, 2, 4, 2, 4, 2, 4, . . . ] = [2, 2, 4]
i.e., a1 = 2, a2 = 2, a3 = 4, a4 = 2, a5 = 4
Then
p1 = a1 = 2, q1 = 1
p2 = a1 a2 + 1 = 5, q2 = a2 = 2
p3 = a3 p2 + p1 = 22, q3 = a3 q2 + q1 = 9
p4 = a4 p3 + p2 = 49, q4 = a4 q3 + q2 = 20
47
p5 = a5 p4 + p3 = 218, q5 = a5 q4 + q3 = 89
or
i 1 2 3 4 5
ai 2 2 4 2 4
pi 2 5 22 49 218
qi 1 2 9 20 89
2 5 22 49 218
ci 1 2 9 20 89
√
5+1
Example 3.2.2. Show that x = 2
= [1, 1, 1, . . . ] = [1] and find the
convergents.
√
5+1
Since x = 2
is between 1.5 and 2, the largest integer less than x is
a1 = 1. Then √
5+1 1
x= =1+
2 x2
where √
1 2 5+1
x2 = √ =√ =
5+1
−1 5−1 2
2
Since x = x2 , and so the last calculation will repeat over and over again.
Hence, the required expansion is
√
5+1
x= = [1, 1, 1, . . . ] = [1]
2
i 1 2 3 4 5 6
ai 1 1 1 1 1 1
pi 1 2 3 5 8 13
qi 1 1 2 3 5 8
1 2 3 5 8 13
ci 1 1 2 3 5 8
48
=⇒ pi ’s and qi ’s follow Fibonacci sequence.
Theorem 3.2.1.
(−1)n
cn − cn−1 = , n≥2
qn qn−1
pn pn−1 (−1)n
− = , n≥2
qn qn−1 qn qn−1
(−1)n
=⇒ cn − cn−1 = , n≥2
qn qn−1
Theorem 3.2.2.
(−1)n−1
cn − cn−2 = , n≥3
qn qn−2
49
Proof. Clearly,
pn pn−2
cn − cn−2 = −
qn qn−2
pn qn−2 − qn pn−2
=
qn qn−2
(an pn−1 + pn−2 )qn−2 − (an qn−1 + qn−2 )pn−2
=
qn qn−2
an pn−1 qn−2 − an qn−1 pn−2
=
qn qn−2
n−1
an (−1)
=
qn qn−2
1 1
c2 − c1 = > 0, c3 − c2 = − <0
q 2 q1 q3 q2
which implies,
c2 > c1 and c3 < c2
a3
c3 − c1 = >0
q3 q 1
c1 < c3 < c2
50
Similarly n = 4 in Theorem 3.2.1,
1
c4 − c3 = >0
q4 q 3
gives
c4 > c3
a4
c4 − c2 = − <0
q4 q2
gives
c4 < c2
c1 < c3 < c5 < · · · < c2n+1 < · · · < c2n < · · · < c6 < c4 < c2
√
The infinite simple continued fraction expansion of 2 is [1, 2, 2, . . . ] =
[1, 2].
51
Then
i 1 2 3 4 5 6
ai 1 2 2 2 2 2
pi 1 3 7 17 41 99
qi 1 2 5 12 29 70
3 7 17 41 99
ci 1 2
= 1.5 5
= 1.4 12
= 1.416 29
= 1.413 70
= 1.414
Arranging them,
i.e.,
1 < 1.4 < 1.413 < · · · < 1.414 < 1.416 < 1.5
52
Substitute n = 2k in the Theorem 3.2.1,
1
c2k − c2k−1 =
q2k q2k−1
=⇒ lL = lU = l
1
x = a1 +
1
a2 +
a3 + . . 1
. .+
1
an−1 +
xn
where xn is the rest of the fraction, which is also an irrational number and
1 1
x n = an + = an +
an+1 + . . xn+1
..
53
where
1
xn+1 = an+1 +
an+2 + . .
..
Since xn+1 is positive,
xn > an
1 1
<
xn+1 an+1
1 1
∴ xn = an + < an +
xn+1 an+1
1
=⇒ an < xn < an +
an+1
or
1 1 1
> > (3.2)
an xn 1
an +
an+1
54
sions;
1
c n = a1 +
a2 + . . 1
. .+
1
an−1 +
an
1
x = a1 +
a2 + . . 1
. .+
1 (3.3)
an−1 +
xn
1
cn+1 = a1 +
a2 + . . 1
. .+
1
an−1 +
1
an +
an+1
1
Since a1 + is common for all of the three, its is enough to
a2 + . . 1
. .+
an−1
1 1 1
compare , , .
an x n 1
an +
an+1
By 3.2 and 3.3, x will always lie between two consecutive convergents cn and
cn+1 that is,
cn > x > cn+1 if n is even.
Since all odd convergents are less than all even convergents, we are forced to
the conclusion that
c2k−1 < x < c2k , k ∈ Z+
55
Bibliography
56