# Continued Fractions

Cahlen Humphreys
Abstract. Continued fractions are a fundamental part of number theory. We will prove that real numbers can be represented through the expansion of simple continued fractions. Convergents are a necessary concept in which we will moderately investigate to help understand the expansion of these continued fractions. Moreover, examples will be provided to further reinforce the steps needed to be taken in order to represent an arbitrary real number as an continued fraction expansion.

AMS Subject Classiﬁcation Number(s): 11A55, 40A15 Keywords: Continued fractions, simple continued fractions, partial quotients, convergents. 1. Introduction When we look at a number like π it can be quite daunting trying to comprehend the fact that it has no discernible pattern with regard to its decimal expansion. Further, it is quite tedious and in some ways not very insightful to observe the decimal expansion by itself. For this reason, among others, continued fractions play and integral role in the theory of numbers. Suppose for example that one wants to ﬁnd a good approximation for π but is limited to only the rational approximation 22/7. For years it was commonly accepted as being a decent approximation, however with the theory of continued fractions we can approximate the value of π more eﬃciently. Continued fractions have been subject to investigation throughout the seventeenth and eighteenth centuries, and continue to be investigated today (C.D. Olds pg. 3). The earliest and most popular observance of a continued fraction comes from the days of Euclid and his algorithm for ﬁnding the greatest common divisor of two numbers. One can simply manipulate the algebra in the algorithm and easily produce a continued fraction. In this paper we are more intersted in how to represent real numbers, both rational and irrational, through the expansion of a continued fraction. Convergents are an important concept with regard to continued fractions, especially when we are looking at the approximation of numbers. Lets take the
2010 Mathematics Subject Classiﬁcation. Primary 11A55.
1

2

CAHLEN HUMPHREYS

lengendary π as a quick example. Observe that 22/7 is only the ﬁrst convergent of the rational approxmation through a continued fraction. That is, 1 22 =3+ . 7 7 However if we go further to the second convergent we get, 333 =3+ 106 and one additional step we get that 355 =3+ 113 1 7+ 1 15 + . 1 7+ 1 15

1 1 It is clear that our approximation for π gets more and more precise the convergents a get larger and larger. This is explained more in Section 6 and 7 where we discuss convergents and expansions for irrational numbers through continued fractions. So lets begin our investigation with continued fractions. Beginning with notation and deﬁnitions and ending with the expansion of rational and irrational numbers. 2. Deﬁnitions and Notation Observe the expression below a1 + a2 + a3 + b1 b2 b3 a4 + b4 .. . .

This expression is known as a continued fraction, and this is its most basic form. The numbers a1 , a2 , a3 , . . . and b1 , b2 , b3 , . . . may be real numbers or complex numbers. Further, a continued fraction can be inﬁnite or ﬁnite. We will only be discussing simple continued fractions which have the form a1 + a2 + a3 + 1 1 1 a4 + 1 ..

.

where all the numerators after the ﬁrst term are 1. The ﬁrst term a1 can be positive, negative, or zero. The numbers a1 , a2 , a3 , . . . are all positive.

CONTINUED FRACTIONS

3

Finite simple continued fractions will be represented as the form a1 + a2 + a3 + a4 + .. 1 1 1 1 .+ 1 an−1 + 1 an

where there are only ﬁnitely many terms a1 , a2 , a3 , . . . , an . One should note that continued fractions can also take on inﬁnitely many ai ’s, which we will discuss later in this paper. Unless otherwise indicated, all of our examples and theorems will deal exclusively with simple continued fractions. Another convenient way to write these ﬁnite simple continued fractions is of the form 1 1 1 [a1 , a2 , . . . , an ] = a1 + a2 + a3 + . . . + an where after each + we lower the fraction. We will also occasionally restrict our notation to the simple compact form [a1 , a2 , a3 , . . . , an ] and we call a1 , a2 , a3 , . . . , an simply partial quotients. 3. Example of Rational Expansion 3.1. Example. Rational numbers are of the form p/q where p and q are inte67 , which can represented through gers, and q = 0. Consider the rational number 13 a simple ﬁnite continued fraction. Observe, 67 =5+ 13 1 1 6+ 2 =5+ 1 1 6+2

and we can also represent this expansion simply as [5, 6, 2]. Further observe that this can be conﬁrmed through simply using the Euclidean Algorithm. 67 = 5 · 13 + 2 13 = 6 · 2 + 1 We now rewrite these equations as 67 2 =5+ 13 13 13 1 =6+ 2 2

4

CAHLEN HUMPHREYS

Note that we get the continued fraction above by simply substituting the second equation into the ﬁrst. Note that, 1 67 =5+ 13 13 2 so we can now substitute to get 67 =5+ 13 1 6+ 1 2 =5+ 1 6+ 1 2

which is our continued fraction as desired. Observe that we can convert the continued fraction back into rational form. 1 1 67 2 = =5+ =5+ =5+ 13 13 1 12 1 13 6+ + 2 2 2 2 So in some way it is easier to go from a continued fraction to a rational number, rather than the other way around. 5+ 3.2. Example. Lets take the rational number 125/7 and ﬁnd the simple continued fraction expansion. Observe that 125 = 7 · 17 + 6. Now we divide by 7 to get 125 6 = 17 + 7 7 1 = 17 + . 7 6 We now repeat the process with 7/6, observe, 7=6·1+1 and dividing by 6 we get 7 1 =1+ . 6 6 Now we substitute this into our previous equation and get 125 = 17 + 7 . 1 1+ 6 1 1

Again, we repeat the process with 6/1 and get 6 = 1 · 6 + 0. 1

CONTINUED FRACTIONS

5

Observe that our remainder is now 0, so this is the farthest we can go with expanding this number into a continued fraction. Hence, our ﬁnal product is, = [17, 1, 6]. 1 1+ 6 One should note that this is the standard procedure for expanding rational numbers into continued fractions. 4. Expansion of Rational Fractions In the previous example we saw that we could represent a rational number as a continued fraction. We now wish to show that this is possible for any rational number. Theorem 4.1 (C.D. Olds (1.1) pg 14). Any ﬁnite simple continued fraction represents a rational number. Conversely, any rational number p/q can be represented as a ﬁnite simple continued fraction; with the exceptions to be noted below, the representation, or expansion, is unique. Proof. Going from a ﬁnite simple continued fraction to a rational number is not particularly diﬃcult, as shown in the example above. So we will prove the converse, that any rational number can be represented as a ﬁnite simple continued fraction. Let p/q , q > 0, be any rational fraction. We divide p by q to obtain r1 p = a1 + , (4.1) q q 125 = 17 + 7 1

0 ≤ r1 ≤ 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 . Note that a1 can be negative, zero, or positive as explained in the deﬁnitions section. If r1 = 0, the process terminates and the continued fraction expansion for p/q is [a1 ]. If r1 = 0, we write (4.2) 1 p = a1 + , q q r1 0 < r1 < q,

and repeat the division process, dividing q by r1 to obtain q r2 (4.3) = a2 + , 0 ≤ r2 < r1 . r1 r1 Notice now that q/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, the process stops and we substitute q/r1 = a2 from (4.3) into (4.2) to obtain, p 1 = a1 + = [a1 , a2 ] q a2 as the continued fraction expansion for p/q .

6

CAHLEN HUMPHREYS

If r2 = 0, we write (4.3) in the form 1 q = a2 + , r1 r1 r2

(4.4)

0 < r2 < r1 ,

and repeat the division process using r1 /r2 . We observe that the calculations stop when we come to a remainder rn = 0. Is it possible never to arrive at an rn which is zero, so that the division process continues indeﬁnitely? This is clearly impossible, 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 remander rn which is equal to zero, we shall be in the ridiculous position of having discovered an inﬁnite number of distinct positive integers less than a ﬁnite positive integer q . Hence, by successive divisions we obtain a sequence of equations: r1 p = a1 + , q q q r2 = a2 + , r1 r1 r1 r3 = a3 + , r2 r2 (4.5) ............... rn−3 rn−1 = an−1 + , rn−2 rn−2 0 rn−2 = an + = an + 0, rn−1 rn−1 ......... 0 < r1 < q,

0 < r2 < r1 ,

0 < r3 < r2 ,

0 < rn−1 < rn−2 ,

rn = 0,

terminating, after a certain ﬁnite number of divisions, with the equation in which the remainder rn is equal to zero. It is now easy to represent p/q as a ﬁnite simple continued fraction. From the ﬁrst two equations in (4.5) we have 1 1 p = a1 + = a1 + q q 1 a2 + r1 r1 r2

CONTINUED FRACTIONS

7

Using the third equation in (4.5) we replace r1 /r2 by 1 , r2 r3 and so on, until we ﬁnally obtain the expression p 1 1 1 (4.6) = a1 + = [a1 , a2 , . . . , an ] q a2 + a3 + . . . + an a3 + The uniqueness of the expansion (4.6) 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 = an 1 (a − 1) + 1 1 ,

so that (4.6) can be replaced by p (4.7) = [a1 , a2 , . . . , an−1 , an − 1, 1]. q On the other hand, if an = 1, then 1 1 an−1 + an so that (4.6) becomes (4.8) p = [a1 , a2 , . . . , an−2 , an−1 + 1]. q = 1 , (an−1 + 1)

5. Example of Irrational Expansion Much like our ﬁrst example, irrational numbers can also be represented as simple continued fractions. In the case of rational numbers, we can represent them with ﬁnitely many partial quotients. In the case of irrational numbers we will observe that the expansion is inﬁnite, hence we will have inﬁnitely many partial quotients. Observe that through each step we obtain and more precise approximation of the irrational number. 5.1. Example. Appropriately, we will continue our example by expanding one of the most popular irrational numbers in history, that being π . The largest integer < π = 3.14 . . . is a1 = 3. Thus, 1 1 =3+ . x1 x1 Now we solve this equation for x1 and get π = a1 + x1 = 1 ≈ 7.06251. π−3

8

CAHLEN HUMPHREYS

So at the point we’re at 1 . 1 π−3 Then we continue with the same process as the beginning. The largest integer < x1 = 7.06251 . . . is a2 = 7. Thus, π =3+ π =3+ 1 1 7+ x2 1 7+ π−3= 1 7+ 7+ 1 x2 1 x2 .

As before, we solve for x2 and we get π =3+

1 1 = x2 π−3 1 22 − 7π = x2 π−3 π−3 ≈ 15.9966 x2 = 22 − 7π Continuing this process inﬁnitely we get the simple continued fraction expansion of π π =3+ 7+ 1 1 15 + 1 .. . = [3, 7, 15, . . . ]

√ 5.2. Example. Let’s solve another √ irrational number, take 3 for example. We ﬁrst take the lowest integer values of 3, thus a0 = 1. So we begin with √ 1 3=1+ x1 and solving for x1 we get, x1 = √ So at this point we are at √ 3=1+ √ 1 1 3−1 1 . 3−1

CONTINUED FRACTIONS

9

and the lowest integer value of x1 ≈ 1.3660 . . . , so a1 = 1. We now have, x1 = a1 + From here we substitute for x1 and get √ which implies that x2 = 1 1 =1+ x2 3−1 1 1 =1+ . x2 x2

3−1 √ ≈ 2.732 . . . . 2− 3 And we repeat by taking the lowest integer value of x2 which is a2 = 2. At this point we are at √ 1 3=1+ . 1 1+ 1 2+ x3 Now we want to solve for x3 1 x2 = 2 + x3 and after we substitute for x2 we get √ 3−1 1 √ =2+ x 2− 3 3 which simpliﬁes to √ 2− 3 x3 = √ ≈ 1.3660 . . . . 3 3−5 Observe that x3 is approximately the same value as x1 , so we are going to get a pattern and can stop here. Hence, we have in the end that √ 1 = [1, ¯ 1, ¯ 2, . . . ] 3=1+ 1 1+ 1 2+ 1 1+ . 2 + .. where 1 and 2 repeat inﬁnitely. 6. Convergents Before we begin to explain the expansion of irrational numbers it is vital that we discuss the concept of convergents of continued fractions. In this section we will be looking at three diﬀerent theorems that will be essential in proving that rational numbers can be represented as ﬁnite continued fraction, and more importantly, that irrational numbers can be represented as inﬁnite continued fractions. Convergents are essentally cutting up continued fraction expansions into segments, and then solving them for that segment. We can easily approximate numbers to

10

CAHLEN HUMPHREYS

very precise values when utilizing convergents correctly. Take the continued fraction α = r1 = [a1 , a2 , a3 , . . . , an ] = (6.1)
p q p q

= [a0 , a1 , a2 , . . . , an ], and let q=p

. Then we can represent p and q as

p = a0 q + q ,

which we require for the next few theorems. If we represent a segment of α as sk = [a0 , a1 , a2 , . . . , ak ] where a < n, then we call it the k th-order convergent (or approximant ) of the continued from α. This concept is deﬁned in exactly the same way for ﬁnite and inﬁnite continued fractions. The only diﬀerence is that a ﬁnite continued fraction has a ﬁnite number of convergents, whereas an inﬁnite continued fraction has an inﬁnite number of them. Take for example an n th-order continued fraction α = [a0 , a1 , a2 , . . . , an ], then obviously pn = α; qn such a continued fraction has n + 1 convergents (of orders, 0, 1, 2, . . . , n). Theorem 6.1 (Khinchin (1) pg. 4). (the rule for the formation of convergents). For arbitrary k ≥ 2, pk = ak pk−1 + pk−2 , (6.2) qk = ak qk−1 + qk−2 . Proof. In the case of k = 2, the formulas in (6.2) are easily veriﬁed directly. Let us suppose that they are true for all k < n. Let us then consider the continued fraction [a1 , a2 , a3 , . . . , an ] and let us denote by pr /qr its r th-order convergent. Then by (6.1) pn = a0 pn−1 + qn−1 , qn = pn−1 . And since, by hypothesis, pn−1 = an pn−2 + pn−3 , qn−1 = an qn−2 + qn−3 (here, we have an rather than an−1 because the fraction [a1 , a2 , a3 , . . . , an ] begins with a1 and not with a0 ), it follows that pn = a0 (an pn−2 + pn−3 ) + (an qn−2 + qn−3 ) = an (a0 pn−2 + qn−2 ) + (a0 pn−3 + qn−3 ) = an pn−1 + pn−2 , qn = an pn−2 + pn−3 = an qn−1 + qn−2 , which completes the proof.

CONTINUED FRACTIONS

11

These recursion formulas in (6.2), which express the numerator and denominator of an n th-order convergent in terms of the element an and the numerators and denominators of the two preceding convergets, serve as the formal basis of the entire theory of continued fractions. Theorem 6.2 (Khinchin (5) pg. 7). For arbitrary k (1 ≤ k ≤ n), (6.3) [a0 , a1 , a2 , . . . , an ] = pk−1 rk + pk−2 . qk−1 rk + qk−2

(Here, pi , qi , ri refer to the continued fraction on the left side of this equation.) Proof. We omit this proof for the sake of brevity. To every inﬁnite continued fraction (6.4) [a0 , a1 , a2 , . . . ],

there corresponds an inﬁnite sequence of convergents (6.5) pk p0 p1 , ,..., ,.... q0 q1 qk

Every convergent is some real number. If the sequence (6.5) converges, that is, if it has a unique limit α, it is natural to consider this number α as the value of the continued fraction (6.4) and to write α = [a0 , a1 , a2 , . . . ]. The continued fraction itself is then said to converge. If the sequence does not have a deﬁnite limit, we say that the continued fraction diverges. Theorem 6.3 (Khinchin (7) pg. 8). If the inﬁnite continued fraction [a0 , a1 , a2 , . . . ] converges, so do all of its remainders; conversely, if at least one of the remainders of the continued fraction [a0 , a1 , a2 , . . . ] converges, the continued fraction itself converges. Proof. Let us agree to denote by pk /qk the convergents of a given continued fraction [a0 , a1 , a2 , . . . ], and by pk /qk the convergents for any of its remainders, for example, rn . From Theorem 6.2 we have, we have (6.6) pn−1 qk + pn−2 pn+k k = [a0 , a1 , a2 , . . . , an+k ] = (k = 0, 1, . . . ). p qn+k qn−1 qk + qn−2
k

p

It follows immediately that if the remainder rn converges, that is, if as k → ∞ the fraction pk /qk approaches a limit which we shall also denote by rn , then the fraction pn+k /qn+k will converge to a limit α equal to (6.7) α= pn−1 rn + pn−2 . qn−1 rn + qn−2

By solving (6.6) for pk /qk , we establish the validity of the converse, thus completing the proof of the theorem.

12

CAHLEN HUMPHREYS

7. Expansion of Irrational Numbers The procedure for expanding an irrational number is fundamentally the same as that used for rational numbers. Therefore, we introduce a new theorem which validates the inﬁnite simple continued fraction expansion of an irrational number. Theorem 7.1 (Khinchin (14) pg. 16). To every real number α, there corresponds a unique continued fraction with value equal to α. This fraction is ﬁnite if α is rational and inﬁnite if α is irrational. Proof. We denote a0 the largest integer not exceeding α. If α is not an integer, the relation 1 (7.1) α = a1 + r1 allows us to determine the number r1 . Here, clearly, r1 > 1, since 1 (7.2) = α − a0 < 1. r1 In general, if rn is not an integer, we denote by an the largest integer not exceeding rn and deﬁne the number rn+1 by the relation 1 (7.3) rn = an + . rn+1 This procedure can be continued as long as rn is not an integer; here, clearly, rn > 1 (n ≥ 1). Equation (7.1) shows that α = [a0 , r1 ]. Suppose that, in general, (7.4) Then, from (7.3), we have α = [a0 , a1 , a2 , . . . , an−1 , an , rn+1 ]; thus, (7.4) is valid for all n (assuming, of course, that r1 , r2 , . . . , rn−1 are not integers). If the number α is rational, all the rn still clearly be rational. It is easy to see that, in this case, our process will stop after a ﬁnite number of steps. If, for example, rn = a/b, then a − ban c rn − an = = , b b where c < b, since rn − an < 1. Equation (7.3) then gives b rn+1 = c (provided c is not equal to zero, that is, if rn is not an integer; if rn is an integer, our assertion is already satisﬁed). Thus, rn+1 has a smaller denominator than does rn . It follows from this that if we consider r1 , r2 , . . . , we must eventually come to an integer rn = an . But, in this case, (7.4) asserts that the number α is represented by a ﬁnite continued fraction, the last element of which is an = rn > 1. α = [a0 , a1 , a2 , . . . , an−1 , rn ].

CONTINUED FRACTIONS

13

If α is irrational, then all the rn are irrational and our process is inﬁnite. Setting pn [a0 , a1 , a2 , . . . , an ] = qn (where the fraction pn /qn is irreducible and qn > 0), we have, by Theorem 6.3 and (7.4), pn−1 rn + pn−2 α= (n ≥ 2). qn−1 rn + qn−2 On the other hand, it is obvious that pn pn−1 an + pn−2 = , qn qn−1 an + qn−2 so that pn (pn−1 qn−2 − qn−1 pn−2 )(rn − an ) α− = qn (qn−1 rn + qn−2 )(qn−1 an + qn−2 ) and, consequently, pn 1 1 α− < < 2 qn (qn−1 rn + qn−2 )(qn−1 an + qn−2 ) qn Thus, pn →α as n → ∞; qn but this means that the inﬁnite continued fraction [a0 , a1 , a2 , . . . ] has as its value the given number α. Thus it is shown that any number α can be represented by a continued fraction; this fraction is ﬁnite if α is rational and inﬁnite if α is irrational. 8. Conclusion We have gone over quite a few diﬀerent theorems in this paper, however all were geared towards proving that both rational real numbers and irrational real numbers can be represented as continued fractions. The former being a ﬁnite expansion, and the latter being an inﬁnite expansion. Continued fractions help us look at and analyze numbers in a way which is incredibly useful in many diﬀerent branches of mathematics.

References
1. Olds, C.W., Continued Fractions, Random House, Stanford, CA, 1963. 2. Khinchin, A. Ya., Continued Fractions, Dover Publications, Chicago, IL, 1964. Boise State University E-mail address : cahlenhumphreys@u.boisestate.edu