Professional Documents
Culture Documents
By Doron Zeilberger
Important Definition: A general (finite) continued fraction (of length k) looks as follows
b1
a0 + b2
.
a1 + b3
a2 + ...
3
2+ 5 .
2+ 4
3 3 12 34
2+ 5 =2+ 11 =2+ = .
2+ 4 4
11 11
34
Ans. to 24.1: 11 .
If all the numerators, bi are 1, then we have a simple continued fraction (the best kind).
Important Definition: A simple (finite) continued fraction (of length k) looks as follows
1
a0 + 1 .
a1 + 1
a2 + ...
Of course, every finite continued fraction (both simple and general) is automatically a positive
rational number, but the converse is also true.
Important Fact: Every positive rational number a/b (where a and b are positive integers) can be
written as a simple continued fraction.
Recursive algorithm:
1
Write x = bxc + {x} where bxc is the integer part and {x} is the fraction part.
Otherwise
CF (x) = bxc + CF (1/{x}) .
19
Problem 24.2: Convert 4 into a continued fraction .
19
Sol. to 24.2: 4 = 4 + 34 , so
19 1
CF ( )=4+ .
4 CF ( 43 )
4
Now 3 = 1 + 13 , so
4 1
CF ( ) = 1 + .
3 CF (3)
Now 3 = 3 + 0, so CF (3) = 3. Now let’s go to the back journey
4 1
CF ( ) = 1 + .
3 3
19 1
CF ( )=4+ 1 .
4 1+ 3
19 1
Ans. to 24.2: The continued fraction representation of 4 is 4 + 1+ 31
, or [4, 1, 3] for short.
x2 − 2 = 0 .
(i.e. a = 1, b = 0, c = −2.
3
Note: x = 2 satisfies the quadratic equation
3x2 − 5x + 2 = 0 ,
2
A pure periodic infinite continued fraction is anything of the form (let’s assume that its value is
> 1)
[a1 , . . . , ak , a1 , . . . , ak , a1 , . . . , ak , . . .] ,
Proof and Algorithm: Since it is an infinite continued fraction, it must be irrational. Let’s call
x = [a1 , . . . , ak , a1 , . . . , ak , a1 , . . . , ak , . . .] ,
Then, of course
x = [a1 , . . . , ak , x] ,
A + Bx
,
C + Dx
for some positive integers A, B, C, D. So we have the equation
A + Bx
x= .
C + Dx
Doing the algebra, gives a quadratic equation for x.
Problem 24.3: Express as a quadratic irrationality the following periodic simple continued fraction
x:
x = [2, 3, 2, 3, 2, 3, 2, 3, . . . ] ,
Sol. to 24.3:
1 1 x 7x + 2
[2, 3, x] = 2 + 1 =2+ 3x+1 =2+ = .
3+ x x
3x + 1 3x + 1
So x satisfies
7x + 2
x= .
3x + 1
Multiplying by the denominator 3x + 1, we get:
x(3x + 1) = 7x + 2 ,
expanding:
3x2 + x = 7x + 2 .
3x2 + x − 7x − 2 = 0 .
So:
3x2 − 6x − 2 = 0 .
3
Solving it we get
p √ √
−(−6) ± (−6)2 − 4(3)(−2) 6 ± 60 15
x= = =1± .
2·3 6 3
√
But, x is positive, so it is x = 1 + 31 15.
√
Ans. to 24.3: The continued fraction [2, 3]∗ equals 1 + 1
3 15.
Important Definition: An ultimately periodic infinite continued fraction is something of the form
[A1 , A2 , A3 , , Am , a1 , a2 , . . . , ak , a1 , a2 , . . . , ak , a1 , a2 , . . . , ak . . .] ,
where [A1 , A2 , . . . , Am ] is the beginning and a1 , . . . , ak is the ultimate period, that repeats for
ever.
Proof/Algorithm: Let
x = [A1 , A2 , A3 , , Am , a1 , a2 , . . . , ak , a1 , a2 , . . . , ak , a1 , a2 , . . . , ak . . .] ,
and
y = [a1 , a2 , . . . , ak , a1 , a2 , . . . , ak , a1 , a2 , . . . , ak . . .] .
x = [A1 , A2 , A3 , , Am , y] .
Cy + D
x= ,
Ey + F
x = [1, 3, 2, 3, 2, 3, 2, 3, 2, 3, . . . ] ,
4
Now
1 1 y 4y + 1
x = [1, 3, y] = 1 + 1 =1+ 3y+1 =1+ = .
3+ y y
3y + 1 3y + 1
So √
1
4(1 + 3 15) +1
x= 1
√
3(1 + 3 15) +1
4
√
5+ 3 15
= √
4+ 15
√
Multiplying top and bottom by the conjugate of the bottom, 4 − 15, gives
√ √
(5 + 43 15)(4 − 15)
x= √ √
(4 + 15)(4 − 15)
√
20 + ( 16 4
3 − 5) 15 − 3 (15)
=
16 − 15
√
1
20 + 3 15 − 20 1√
= = 15 .
16 − 15 3
1
√
Ans. to 24.4: x = 3 15.
Important Reminder: √
1 a−b Q
√ = 2 .
a +b Q a − b2 Q
√
So the reciprocal of an expression of the form a + b Q with a and b rational numbers and Q a
positive integer, also has this form.
√
Problem 24.5: Convert 2 into an ultimately periodic continued fraction.
√
Sol. to 24.5: b 2c = 1, so we write
√ √
2 = 1 + ( 2 − 1) .
Now √
1 2+1 √
√ =√ 2 =1+ 2
2−1 2 −1
and we have, so far
√ 1
2=1+ √ .
1+ 2
√
b1 + 2c = 2, so we write
√ √ 1 1
1+ 2 = 2 + ( 2 − 1) == 2 + =2+ √ .
√1 1+ 2
2−1
5
√
But this is self-similar. Writing x = 1 + 2, we have the relation
1
x=2+ .
x
√
In other words x = [2∞ ]. Going back to 2 = 1 + 1/x, we have:
√
Ans. to 24.5: 2 = [1, 2∞ ].
Go to maple, and do
convert(x,confrac);
detect a period, and prove it using the previous type of problem (converting an ultimately periodic
infinite continued fraction into a quadratic irrationality).