A ``general'' continued fraction representation of a Real Number is of the form

(1) |

(2) |

(3) |

(4) |

(5) |

(6) |

Continued fractions provide, in some sense, a series of ``best'' estimates for an Irrational Number. Functions can
also be written as continued fractions, providing a series of better and better rational approximations. Continued fractions
have also proved useful in the proof of certain properties of numbers such as *e* and (Pi). Because
irrationals which are square roots of Rational Numbers have periodic continued fractions, an exact
representation for a tabulated numerical value (i.e., 1.414... for Pythagoras's Constant, ) can
sometimes be found.

Continued fractions are also useful for finding near commensurabilities between events with different periods. For example, the Metonic cycle used for calendrical purposes by the Greeks consists of 235 lunar months which very nearly equal 19 solar years, and 235/19 is the sixth Convergent of the ratio of the lunar phase (synodic) period and solar period (365.2425/29.53059). Continued fractions can also be used to calculate gear ratios, and were used for this purpose by the ancient Greeks (Guy 1990).

If only the first few terms of a continued fraction are kept, the result is called a Convergent. Let be
convergents of a nonsimple continued fraction. Then

(7) |

(8) |

(9) |

(10) |

(11) |

A *finite simple* continued fraction representation terminates after a finite number of terms. To ``round'' a
continued fraction, truncate the last term unless it is , in which case it should be added to the previous term
(Beeler *et al. *1972, Item 101A). To take one over a continued fraction, add (or possibly delete) an initial 0 term. To
negate, take the Negative of all terms, optionally using the identity

(12) |

(13) |

(14) |

Consider the Convergents of a *simple* continued fraction, and define

(15) |

(16) |

(17) |

(18) |

(19) |

(20) |

(21) | |||

(22) |

Furthermore,

(23) |

(24) |

(25) |

(26) | |||

(27) |

The Even convergents of an infinite simple continued fraction form an Increasing Sequence, and the Odd convergents form a Decreasing Sequence (so any Even convergent is less than any Odd convergent). Summarizing,

(28) |

(29) |

The Square Root of a Squarefree Integer has a periodic continued fraction of the form

(30) |

(31) |

(32) | |

(33) | |

(34) | |

(35) |

(36) |

(37) | |||

(38) |

The first follows from

(39) |

Therefore,

(40) |

(41) |

(42) |

(43) |

(44) |

2 | 22 | ||

3 | 23 | ||

5 | 24 | ||

6 | 26 | ||

7 | 27 | ||

8 | 28 | ||

10 | 29 | ||

11 | 30 | ||

12 | 31 | ||

13 | 32 | ||

14 | 33 | ||

15 | 34 | ||

17 | 35 | ||

18 | 37 | ||

19 | 38 | ||

20 | 39 | ||

21 | 40 |

The periods of the continued fractions of the square roots of the first few nonsquare integers 2, 3, 5, 6, 7, 8, 10,
11, 12, 13, ... (Sloane's A000037) are 1, 2, 1, 2, 4, 2, 1, 2, 2, 5, ... (Sloane's A013943; Williams 1981, Jacobson *et al. *1995).
An upper bound for the length is roughly
.

An even stronger result is that a continued fraction is periodic Iff it is a Root of a quadratic
Polynomial. Calling the portion of a number remaining after a given convergent the ``tail,'' it must be true that
the relationship between the number and terms in its tail is of the form

(45) |

Logarithms
can be computed by defining , ...and the Positive
Integer , ...such that

(46) |

(47) |

(48) |

A geometric interpretation for a reduced Fraction consists of a string through a Lattice of points with ends at and (Klein 1907, 1932; Steinhaus 1983; Ball and Coxeter 1987, pp. 86-87; Davenport 1992). This interpretation is closely related to a similar one for the Greatest Common Divisor. The pegs it presses against give alternate Convergents , while the other Convergents are obtained from the pegs it presses against with the initial end at . The above plot is for , which has convergents 0, 1, 2/3, 3/4, 5/7, ....

Let the continued fraction for be written
. Then the limiting value is *almost always*
Khintchine's Constant

(49) |

Continued fractions can be used to express the Positive Roots of any Polynomial equation. Continued fractions
can also be used to solve linear Diophantine Equations and the Pell Equation.
Euler showed that if a Convergent Series can be written in the form

(50) |

(51) |

Gosper has invented an Algorithm for performing analytic Addition, Subtraction, Multiplication, and Division using continued fractions. It requires keeping track of eight Integers which are conceptually arranged at the Vertices of a Cube. The Algorithm has not, however, appeared in print (Gosper 1996).

An algorithm for computing the continued fraction for from the continued fraction for is given by
Beeler *et al. *(1972, Item 101), Knuth (1981, Exercise 4.5.3.15, pp. 360 and 601), and Fowler (1991). (In line 9 of Knuth's solution,
should be replaced by
.)
Beeler *et al. *(1972) and
Knuth (1981) also mention the bivariate case
.

**References**

Abramowitz, M. and Stegun, C. A. (Eds.).
*Handbook of Mathematical Functions with Formulas, Graphs, and Mathematical Tables, 9th printing.*
New York: Dover, p. 19, 1972.

Acton, F. S. ``Power Series, Continued Fractions, and Rational Approximations.''
Ch. 11 in *Numerical Methods That Work, 2nd printing.* Washington, DC: Math. Assoc. Amer., 1990.

Ball, W. W. R. and Coxeter, H. S. M. *Mathematical Recreations and Essays, 13th ed.*
New York: Dover, pp. 54-57 and 86-87, 1987.

Beeler, M.; Gosper, R. W.; and Schroeppel, R. *HAKMEM.* Cambridge, MA: MIT Artificial Intelligence Laboratory, Memo AIM-239,
pp. 36-44, Feb. 1972.

Beskin, N. M. *Fascinating Fractions.* Moscow: Mir Publishers, 1980.

Brezinski, C. *History of Continued Fractions and Padé Approximants.* New York: Springer-Verlag, 1980.

Conway, J. H. and Guy, R. K. ``Continued Fractions.'' In *The Book of Numbers.* New York: Springer-Verlag,
pp. 176-179, 1996.

Courant, R. and Robbins, H. ``Continued Fractions. Diophantine Equations.'' §2.4 in Supplement to Ch. 1 in
*What is Mathematics?: An Elementary Approach to Ideas and Methods, 2nd ed.*
Oxford, England: Oxford University Press, pp. 49-51, 1996.

Davenport, H. §IV.12 in *The Higher Arithmetic: An Introduction to the Theory of Numbers, 6th ed.*
New York: Cambridge University Press, 1992.

Euler, L. *Introduction to Analysis of the Infinite, Book I.* New York: Springer-Verlag, 1980.

Fowler, D. H. *The Mathematics of Plato's Academy.* Oxford, England: Oxford University Press, 1991.

Guy, R. K. ``Continued Fractions'' §F20 in
*Unsolved Problems in Number Theory, 2nd ed.* New York: Springer-Verlag, p. 259, 1994.

Jacobson, M. J. Jr.; Lukes, R. F.; and Williams, H. C. ``An Investigation of Bounds for the Regulator of Quadratic Fields.''
*Experiment. Math.* **4**, 211-225, 1995.

Khinchin, A. Ya. *Continued Fractions.* New York: Dover, 1997.

Kimberling, C. ``Continued Fractions.'' http://cedar.evansville.edu/~ck6/integer/contfr.html.

Klein, F. *Ausgewählte Kapitel der Zahlentheorie.* Germany: Teubner, 1907.

Klein, F. *Elementary Number Theory.* New York, p. 44, 1932.

Kline, M. *Mathematical Thought from Ancient to Modern Times.* New York: Oxford University Press, 1972.

Knuth, D. E. *The Art of Computer Programming, Vol. 2: Seminumerical Algorithms, 2nd ed.*
Reading, MA: Addison-Wesley, p. 316, 1981.

Moore, C. D. *An Introduction to Continued Fractions.* Washington, DC: National
Council of Teachers of Mathematics, 1964.

Olds, C. D. *Continued Fractions.* New York: Random House, 1963.

Pettofrezzo, A. J. and Bykrit, D. R. *Elements of Number Theory.* Englewood Cliffs, NJ: Prentice-Hall, 1970.

Press, W. H.; Flannery, B. P.; Teukolsky, S. A.; and Vetterling, W. T. ``Evaluation of Continued Fractions.'' §5.2 in
*Numerical Recipes in FORTRAN: The Art of Scientific Computing, 2nd ed.* Cambridge, England:
Cambridge University Press, pp. 163-167, 1992.

Rose, H. E. *A Course in Number Theory, 2nd ed.* Oxford, England: Oxford University Press, 1994.

Rosen, K. H. *Elementary Number Theory and Its Applications.* New York: Addison-Wesley, 1980.

Sloane, N. J. A. Sequences
A013943 and
A000037/M0613
in ``An On-Line Version of the Encyclopedia of Integer Sequences.''
http://www.research.att.com/~njas/sequences/eisonline.html and Sloane, N. J. A. and Plouffe, S.
*The Encyclopedia of Integer Sequences.* San Diego: Academic Press, 1995.

Steinhaus, H. *Mathematical Snapshots, 3rd American ed.* New York: Oxford University Press, pp. 39-42, 1983.

Van Tuyl, A. L. ``Continued Fractions.'' http://www.calvin.edu/academic/math/confrac/.

Wagon, S. ``Continued Fractions.'' §8.5 in *Mathematica in Action.* New York: W. H. Freeman, pp. 263-271, 1991.

Wall, H. S. *Analytic Theory of Continued Fractions.* New York: Chelsea, 1948.

Williams, H. C. ``A Numerical Investigation into the Length of the Period of the Continued Fraction Expansion of .''
*Math. Comp.* **36**, 593-601, 1981.

© 1996-9

1999-05-26