mathematics
Mathematics is an area of knowledge that includes the topics of numbers, formulas and related structures, shapes and the spaces in which they are contained, and quantities and their changes. These topics are represented in modern mathematics ...
, an infinite periodic continued fraction is a
continued fraction
In mathematics, a continued fraction is an expression obtained through an iterative process of representing a number as the sum of its integer part and the reciprocal of another number, then writing this other number as the sum of its integer ...
that can be placed in the form
:
where the initial block of ''k'' + 1 partial denominators is followed by a block ''k''+1, ''a''''k''+2,...''a''''k''+''m''">'a''''k''+1, ''a''''k''+2,...''a''''k''+''m''of partial denominators that repeats over and over again, ''ad infinitum''. For example, can be expanded to a periodic continued fraction, namely as ,2,2,2,...
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 ''a''''i'' (''i'' ≥ 1) 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 as
:
where, 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 k = -1, a0 = am and
:
the regular continued fraction ''x'' is said to be ''purely periodic''. For example, the regular continued fraction for the
golden ratio
In mathematics, two quantities are in the golden ratio if their ratio is the same as the ratio of their sum to the larger of the two quantities. Expressed algebraically, for quantities a and b with a > b > 0,
where the Greek letter phi ( ...
φ – given by ; 1, 1, 1, ...– is purely periodic, while the regular continued fraction for the square root of two – ; 2, 2, 2, ...– is periodic, but not purely periodic.
As unimodular matrices
Such periodic fractions are in one-to-one correspondence with the real
quadratic irrational In mathematics, a quadratic irrational number (also known as a quadratic irrational, a quadratic irrationality or quadratic surd) is an irrational number that is the solution to some quadratic equation with rational coefficients which is irreducibl ...
s. The correspondence is explicitly provided by Minkowski'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 are unimodular, arbitrary products remain unimodular. Then, given as above, the corresponding matrix is of the form
:
and one has
:
as the explicit form. As all of the matrix entries are integers, this matrix belongs to the
modular group
In mathematics, the modular group is the projective special linear group of matrices with integer coefficients and determinant 1. The matrices and are identified. The modular group acts on the upper-half of the complex plane by fractional ...
Relation to quadratic irrationals
A
quadratic irrational number In mathematics, a quadratic irrational number (also known as a quadratic irrational, a quadratic irrationality or quadratic surd) is an irrational number that is the solution to some quadratic equation with rational coefficients which is irreducibl ...
is an
irrational
Irrationality is cognition, thinking, talking, or acting without inclusion of rationality. It is more specifically described as an action or opinion given through inadequate use of reason, or through emotional distress or cognitive deficiency. T ...
real root of the quadratic equation
:
where the coefficients ''a'', ''b'', and ''c'' are integers, and the
discriminant
In mathematics, the discriminant of a polynomial is a quantity that depends on the coefficients and allows deducing some properties of the roots without computing them. More precisely, it is a polynomial function of the coefficients of the orig ...
, ''b''2 − 4''ac'', is greater than zero. By the
quadratic formula
In elementary algebra, the quadratic formula is a formula that provides the solution(s) to a quadratic equation. There are other ways of solving a quadratic equation instead of using the quadratic formula, such as factoring (direct factoring, ...
every quadratic irrational can be written in the form
:
where ''P'', ''D'', and ''Q'' are integers, ''D'' > 0 is not a perfect square (but not necessarily square-free), and ''Q'' divides the quantity ''P''2 − ''D'' (for example (6+)/4). Such a quadratic irrational may also be written in another form with a square-root of a square-free number (for example (3+)/2) as explained for
quadratic irrational In mathematics, a quadratic irrational number (also known as a quadratic irrational, a quadratic irrationality or quadratic surd) is an irrational number that is the solution to some quadratic equation with rational coefficients which is irreducibl ...
s.
By considering the complete quotients of periodic continued fractions,
Euler
Leonhard Euler ( , ; 15 April 170718 September 1783) was a Swiss mathematician, physicist, astronomer, geographer, logician and engineer who founded the studies of graph theory and topology and made pioneering and influential discoveries in ...
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
Joseph-Louis Lagrange (born Giuseppe Luigi Lagrangiasurd is said to be ''reduced'' if and its conjugate
satisfies 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. 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
A palindrome is a word, number, phrase, or other sequence of symbols that reads the same backwards as forwards, such as the words ''madam'' or ''racecar'', the date and time ''11/11/11 11:11,'' and the sentence: "A man, a plan, a canal – Pana ...
string.
Length of the repeating block
By analyzing the sequence of combinations
:
that can possibly arise when ζ = (''P'' + )/''Q'' is expanded as a regular continued fraction,
Lagrange
Joseph-Louis Lagrange (born Giuseppe Luigi Lagrangiadivisor function
In mathematics, and specifically in number theory, a divisor function is an arithmetic function related to the divisors of an integer. When referred to as ''the'' divisor function, it counts the ''number of divisors of an integer'' (includin ...
have shown that ''L''(''D''), 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" (see
big O notation
Big ''O'' notation is a mathematical notation that describes the limiting behavior of a function when the argument tends towards a particular value or infinity. Big O is a member of a family of notations invented by Paul Bachmann, Edmund L ...
).
Canonical form and repetend
The following iterative algorithm can be used to obtain the continued fraction expansion in canonical form (''S'' is any
natural number
In mathematics, the natural numbers are those numbers used for counting (as in "there are ''six'' coins on the table") and ordering (as in "this is the ''third'' largest city in the country").
Numbers used for counting are called '' cardinal ...
that is not a perfect square):
:
:
:
:
:
:
Notice that ''m''n, ''d''n, and ''a''n 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 0; ''a''1, ''a''2, ''a''3, ...">'a''0; ''a''1, ''a''2, ''a''3, ...is the continued fraction expansion:
:
Example
To obtain as a continued fraction, begin with ''m''0 = 0; ''d''0 = 1; and ''a''0 = 10 (102 = 100 and 112 = 121 > 114 so 10 chosen).
:
:
:
:
So, ''m''1 = 10; ''d''1 = 14; and ''a''1 = 1.
:
Next, ''m''2 = 4; ''d''2 = 7; and ''a''2 = 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 In complex analysis, a branch of mathematics, a generalized continued fraction is a generalization of regular continued fractions in canonical form, in which the partial numerators and partial denominators can assume arbitrary complex values.
A ge ...
. 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 0;1,2, 10,2,1, 20,1,2evaluated at every third term. Combining pairs of fractions produces
:
which is now