A regular continued fraction is a simple continued fraction
(1)
| |||
(2)
| |||
(3)
|
where is an integer and is a positive integer for (Rockett and Szüsz 1992, p. 3).
While regular continued fractions are not the only possible representation of real numbers in terms of a sequence of integers (others include the decimal expansion and Engel expansion), they are a very common such representation that arises most frequently in number theory. Lochs' theorem relates the efficiency of a regular continued fraction expansion with that of a decimal expansion in representing a real number.
A finite regular continued fraction representation terminates after a finite number of terms and therefore corresponds to a rational number. (Bach and Shallit (1996) show how to compute the Jacobi symbol in terms of the simple continued fraction of a rational number .) On the other hand, an infinite regular continued fraction represents a unique irrational number, and each irrational number has a unique infinite continued fraction. Infinite periodic continued fractions have a number of special properties.
Regular 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). Regular continued fractions can also be used to calculate gear ratios, and were used for this purpose by the ancient Greeks (Guy 1990).
The error in approximating a number by a given convergent is roughly the multiplicative inverse of the square of the denominator of the first neglected term.
Lagrange's continued fraction theorem states that a quadratic surd has an eventually periodic continued fraction. For example, the Pythagoras's constant has continued fraction [1; 2, 2, 2, 2, ...]. As a result, an exact representation for a numeric constant can sometimes be inferred if it is suspected to represent an unknown quadratic surd.
Regular continued fractions provide, in some sense, a series of "best" estimates for an irrational number. Functions can also be written as (simple or generalized) 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).
Starting the indexing of a regular continued fraction with ,
(4)
|
is the integer part of , where is the floor function,
(5)
|
is the integral part of the reciprocal of ,
(6)
|
is the integral part of the reciprocal of the remainder, etc. Writing the remainders according to the recurrence relation
(7)
| |||
(8)
|
gives the concise formula
(9)
|
The quantities are called partial quotients, and the quantity obtained by including terms of the continued fraction
(10)
| |||
(11)
| |||
(12)
|
is called the th convergent.
For example, consider the computation of the continued fraction of , given by .
term | value | PQs | convergent | value |
3 | 3.00000 | |||
3.14286 | ||||
3.14151 |
Let the simple continued fraction for be written . Then the limiting value is almost always Khinchin's constant
(13)
|
(OEIS A002210).
Similarly, taking the th root of the denominator of the th convergent as almost always gives the Lévy constant
(14)
|
(OEIS A086702).
Logarithms can be computed by defining , ... and the positive integer , ... such that
(15)
|
(16)
|
and so on. Then
(17)
|
A geometric interpretation for a reduced fraction consists of a string through a lattice of points with ends at and (Klein 1896, 1932; Steinhaus 1999, p. 40; Gardner 1984, pp. 210-211, 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, ....
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.
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 polyhedron vertices of a cube. Although this algorithm has not appeared in print, similar algorithms have been constructed by Vuillemin (1987) and Liardet and Stambul (1998).
Gosper's algorithm for computing the continued fraction for from the continued fraction for is described by Gosper (1972), Knuth (1998, Exercise 4.5.3.15, pp. 360 and 601), and Fowler (1999). (In line 9 of Knuth's solution, should be replaced by .) Gosper (1972) and Knuth (1981) also mention the bivariate case .