]> Continued Fractions - Definition

Definition

A simple continued fraction is an expression of the form

a 1 +1 a 2 +1 a 3 +...

where the a i are a possibly infinite sequence of integers such that a 1 is nonnegative and the rest of the seqence is positive. We often write [a 1 ;a 2 ,a 3 ,...] in lieu of the above fraction. We may also call them regular continued fractions.

Truncating the sequence at a k and computing the resulting expression gives the kth convergent p k/q k for some positive coprime integers p k,q k. The first three convergents are

a 1 ,a 1 a 2 +1 a 2 ,a 1 (a 2 a 3 +1 )+a 3 a 2 a 3 +1

Induction proves the recurrence relations:

p k = a kp k1 +p k2 q k = a kq k1 +q k2

for k3 . We can make these relations hold for all k1 by defining p 1 =0 ,q 1 =1 and p 0 =1 ,q 0 =0 . These correspond to the convergents 0 and , the most extreme convergents possible for a nonegative integer. They also allows us to show

p kq kp k1 q k1 =(1 ) kq kq k1

Thus the difference between successive convergents approaches zero and alternates in sign, so a continued fraction always converges to a real number. This equation also shows that p k and q k are indeed coprime, a small detail glossed over earlier.

A similar induction shows

p kq k2 q kp k2 =a k(1 ) k1

and thus p k/q k decreases for k even, and increases for k odd.

Example

We demonstrate how to compute convergents of a=[1 ;2,2,2 ,...] in practice. Terry Gagen introduced this to me as the “magic table”. I’ll refer to this method by this name, as I don’t know its official title.

We write the sequence a i left to right, and two more rows are started, one for the p i and one for the q i, which we bootstrap with the zero and infinity convergents:

1 2 2 ... 0 1 1 0

For each row, we carry out the recurrence relation from left to right. In other words, for each row entry, write in (number to the left) × (column heading) + (number two to the left):

1 2 2 2 ... 0 1 1 3 7 17 ... 1 0 1 2 5 12 ...

Observe

a=1 +1 1 +[1 ;2,2,2 ,...]=1 +1 a+1

Rearranging, we see a must be a solution to x 2 =2 , but since a is positive (indeed, a>1 ), we have a=2 . We obtain empirical evidence of some of our earlier statements: the convergents 1 /1 ,3 /2 ,7 /5 ,17 /12 ,... approach 2 , alternatively overshooting and undershooting the target, but getting closer each time.