Periodic continued fraction
In mathematics, an infinite periodic continued fraction is a continued fraction that can be placed in the form
where the initial block of k + 1 partial denominators is followed by a block of partial denominators that repeats over and over again, ad infinitum. For example, can be expanded to a periodic continued fraction, namely as .
The partial denominators can in general be any real or complex numbers. That general case is treated in the article convergence problem. The remainder of this article is devoted to the subject of simple continued fractions that are also periodic. In other words, the remainder of this article assumes that all the partial denominators ai are positive integers.
Purely periodic and periodic fractions
Since all the partial numerators in a regular continued fraction are equal to unity we can adopt a shorthand notation in which the continued fraction shown above is written aswhere, in the second line, a vinculum marks the repeating block. Some textbooks use the notation
where the repeating block is indicated by dots over its first and last terms.
If the initial non-repeating block is not present - that is, if
the regular continued fraction x is said to be purely periodic. For example, the regular continued fraction for the golden ratio φ - given by - is purely periodic, while the regular continued fraction for the square root of two - - is periodic, but not purely periodic.
Relation to quadratic irrationals
A quadratic irrational number is an irrational real root of the quadratic equationwhere the coefficients a, b, and c are integers, and the discriminant, b2 − 4ac, is greater than zero. By the quadratic formula every quadratic irrational can be written in the form
where P, D, and Q are integers, D > 0 is not a perfect square, and Q divides the quantity P2 − D. Such a quadratic irrational may also be written in another form with a square-root of a square-free number as explained for quadratic irrationals.
By considering the complete quotients of periodic continued fractions, Euler was able to prove that if x is a regular periodic continued fraction, then x is a quadratic irrational number. The proof is straightforward. From the fraction itself, one can construct the quadratic equation with integral coefficients that x must satisfy.
Lagrange proved the converse of Euler's theorem: if x is a quadratic irrational, then the regular continued fraction expansion of x is periodic. Given a quadratic irrational x one can construct m different quadratic equations, each with the same discriminant, that relate the successive complete quotients of the regular continued fraction expansion of x to one another. Since there are only finitely many of these equations, the complete quotients in the regular continued fraction that represents x must eventually repeat.
Reduced surds
The quadratic surd is said to be reduced if and its conjugatesatisfies the inequalities. For instance, the golden ratio is a reduced surd because it is greater than one and its conjugate is greater than −1 and less than zero. On the other hand, the square root of two is greater than one but is not a reduced surd because its conjugate is less than −1.
Galois proved that the regular continued fraction which represents a quadratic surd ζ is purely periodic if and only if ζ is a reduced surd. In fact, Galois showed more than this. He also proved that if ζ is a reduced quadratic surd and η is its conjugate, then the continued fractions for ζ and for are both purely periodic, and the repeating block in one of those continued fractions is the mirror image of the repeating block in the other. In symbols we have
where ζ is any reduced quadratic surd, and η is its conjugate.
From these two theorems of Galois a result already known to Lagrange can be deduced. If r > 1 is a rational number that is not a perfect square, then
In particular, if n is any non-square positive integer, the regular continued fraction expansion of contains a repeating block of length m, in which the first m − 1 partial denominators form a palindromic string.
Length of the repeating block
By analyzing the sequence of combinationsthat can possibly arise when ζ = /Q is expanded as a regular continued fraction, Lagrange showed that the largest partial denominator ai in the expansion is less than 2, and that the length of the repeating block is less than 2D.
More recently, sharper arguments based on the divisor function have shown that L, the length of the repeating block for a quadratic surd of discriminant D, is given by
where the big O means "on the order of", or "asymptotically proportional to".
Canonical form and repetend
The following iterative algorithm can be used to obtain the continued fraction expansion in canonical form :Notice that mn, dn, and an are always integers.
The algorithm terminates when this triplet is the same as one encountered before.
The algorithm can also terminate on ai when ai = 2 a0, which is easier to implement.
The expansion will repeat from then on. The sequence is the continued fraction expansion:
Example
To obtain as a continued fraction, begin with m0 = 0; d0 = 1; and a0 = 10.So, m1 = 10; d1 = 14; and a1 = 1.
Next, m2 = 4; d2 = 7; and a2 = 2.
Now, loop back to the second equation above.
Consequently, the simple continued fraction for the square root of 114 is
is approximately 10.67707 82520. After one expansion of the repetend, the continued fraction yields the rational fraction whose decimal value is approx. 10.67707 80856, a relative error of
0.0000016% or 1.6 parts in 100,000,000.
Generalized continued fraction
A more rapid method is to evaluate its generalized continued fraction. From the formula derived there:and the fact that 114 is 2/3 of the way between 102=100 and 112=121 results in
which is simply the aforementioned evaluated at every third term. Combining pairs of fractions produces
which is now evaluated at the third term and every six terms thereafter.