where the initial block ofk+1 partial denominators is followed by a block ofm partial denominators that repeatsad infinitum. For example, can be expanded to the periodic continued fraction.
This article considers only the case of periodicregular continued fractions. In other words, the remainder of this article assumes that all the partial denominatorsai (i ≥ 1) are positive integers. The general case, where the partial denominatorsai are arbitrary real or complex numbers, is treated in the articleconvergence problem.
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 as
where, in the second line, avinculum marks the repeating block.[1] Some textbooks use the notation
where the repeating block is indicated by dots over its first and last terms.[2]
If the initial non-repeating block is not present – that is, if k = -1, a0 = am and
the regular continued fractionx is said to bepurely periodic. For example, the regular continued fraction of thegolden ratio φ is purely periodic, while the regular continued fraction of is periodic, but not purely periodic. However, the regular continued fraction of thesilver ratio is purely periodic.
Periodic continued fractions are in one-to-one correspondence with the realquadratic irrationals. The correspondence is explicitly provided byMinkowski's question-mark function. That article also reviews tools that make it easy to work with such continued fractions. Consider first the purely periodic part
This can, in fact, be written as
with the being integers, and satisfying Explicit values can be obtained by writing
which is termed a "shift", so that
and similarly a reflection, given by
so that. Both of these matrices areunimodular, arbitrary products remain unimodular. Then, given as above, the corresponding matrix is of the form[3]
and one has
as the explicit form. As all of the matrix entries are integers, this matrix belongs to themodular group
where the coefficientsa,b, andc are integers, and thediscriminant,, is greater than zero. By thequadratic formula, every quadratic irrational can be written in the form
whereP,D, andQ are integers,D > 0 is not aperfect square (but not necessarily square-free), andQ divides the quantity (for example). Such a quadratic irrational may also be written in another form with a square-root of a square-free number (for example) as explained forquadratic irrationals.
By considering thecomplete quotients of periodic continued fractions,Euler was able to prove that ifx is a regular periodic continued fraction, thenx is a quadratic irrational number. The proof is straightforward. From the fraction itself, one can construct the quadratic equation with integral coefficients thatx must satisfy.
Lagrange proved the converse of Euler's theorem: ifx is a quadratic irrational, then the regular continued fraction expansion ofx is periodic.[4] Given a quadratic irrationalx one can constructm different quadratic equations, each with the same discriminant, that relate the successive complete quotients of the regular continued fraction expansion ofx to one another. Since there are only finitely many of these equations (the coefficients are bounded), the complete quotients (and also the partial denominators) in the regular continued fraction that representsx must eventually repeat.
The quadraticsurd is said to bereduced if and itsconjugatesatisfies 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 (−1/η) 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. Ifr > 1 is a rational number that is not a perfect square, then
In particular, ifn is any non-square positive integer, the regular continued fraction expansion of√n contains a repeating block of lengthm, in which the firstm − 1 partial denominators form apalindromic string.
that can possibly arise when is expanded as a regular continued fraction,Lagrange showed that the largest partial denominatorai in the expansion is less than, and that the length of the repeating block is less than 2D.
More recently, sharper arguments[5][6][7] based on thedivisor function have shown that the length of the repeating block for a quadratic surd of discriminantD ison the order of
The following iterative algorithm[8] can be used to obtain the continued fraction expansion in canonical form (S is anynatural number that is not aperfect square):
Notice thatmn,dn, andan 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,[9] which is easier to implement.
The expansion will repeat from then on. The sequence is the continued fraction expansion:
√114 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 of0.0000016% or 1.6 parts in 100,000,000.
Podsypanin, E.V. (1982). "Length of the period of a quadratic irrational".Journal of Soviet Mathematics.18 (6):919–923.doi:10.1007/BF01763963.S2CID119567810.