maths.free › Number Theory › Deeper water › Continued fraction
Continued fraction
A continued fraction is a mathematical expression written as a fraction whose denominator contains a sum involving another fraction, which may itself be a simple or a continued fraction.
Continued fraction
A continued fraction is a mathematical expression written as a fraction whose denominator contains a sum involving another fraction, which may itself be a simple or a continued fraction. If this iteration (repetitive process) terminates with a simple fraction, the result is a finite continued fraction; if it continues indefinitely, the result is an infinite continued fraction. The special case in which all numerators \(\{a_i\}\) (see image) are equal to one, and all denominators \(\{b_i\}\) are positive integers, is referred to as a simple (or regular) continued fraction. Any positive rational number can be expressed as a finite simple continued fraction, and any positive irrational number can be expressed as an infinite simple continued fraction.
Different areas of mathematics use different terminology and notation for continued fractions. In number theory, the unqualified term continued fraction usually refers to simple continued fractions, whereas the general case is referred to as generalized continued fractions. In complex analysis and numerical analysis, the general case is usually referred to by the unqualified term continued fraction.
The numerators and denominators of continued fractions can be sequences \(\{a_i\},\{b_i\}\) of numbers or functions.
Formulation
A continued fraction is an expression of the form \[x = b_0 + \cfrac{a_1}{b_1 + \cfrac{a_2}{b_2 + \cfrac{a_3}{b_3 + \cfrac{a_4}{b_4 + \ddots\,}}}}\] where the an (n > 0) are the partial numerators, the bn are the partial denominators, and the leading term b0 is called the integer part of the continued fraction.
The successive convergents of the continued fraction are formed by applying the fundamental recurrence formulas: \[\begin{aligned} x_0 &= \frac{A_0}{B_0} = b_0, \\ x_1 &= \frac{A_1}{B_1} = \frac{b_1b_0+a_1}{b_1}, \\ x_2 &= \frac{A_2}{B_2} = \frac{b_2(b_1b_0+a_1) + a_2b_0}{b_2b_1 + a_2},\ \dots \end{aligned}\] where An is the numerator and Bn is the denominator, called continuants, of the nth convergent. They are given by the three-term recurrence relation \[\begin{aligned} A_n &= b_n A_{n-1} + a_n A_{n-2}, \\ B_n &= b_n B_{n-1} + a_n B_{n-2} \qquad \text{for } n \ge 1 \end{aligned}\] with initial values \[\begin{aligned} A_{-1} &= 1,& A_0&=b_0,\\ B_{-1}&=0, & B_0&=1. \end{aligned}\]
If the sequence of convergents {xn} approaches a limit, the continued fraction is convergent and has a definite value. If the sequence of convergents never approaches a limit, the continued fraction is divergent. It may diverge by oscillation (for example, the odd and even convergents may approach two different limits), or it may produce an infinite number of zero denominators Bn.
History
The story of continued fractions begins with the Euclidean algorithm, a procedure for finding the greatest common divisor of two natural numbers m and n. That algorithm introduced the idea of dividing to extract a new remainder, and then dividing by the new remainder repeatedly.
Nearly two thousand years passed before Bombelli (1579) devised a technique for approximating the roots of quadratic equations with continued fractions in the mid-sixteenth century. Now the pace of development quickened. Just 24 years later, in 1613, Pietro Cataldi introduced the first formal notation for the generalized continued fraction. Cataldi represented a continued fraction as \[{a_0\cdot} \,\&\, \frac{n_1}{d_1\cdot} \,\&\, \frac{n_2}{d_2\cdot} \,\&\, \frac{n_3}{d_3}\] with the dots indicating where the next fraction goes, and each & representing a modern plus sign.
Late in the seventeenth century John Wallis introduced the term "continued fraction" into mathematical literature. New techniques for mathematical analysis (Newton's and Leibniz's calculus) had recently come onto the scene, and a generation of Wallis' contemporaries put the new phrase to use.
In 1744 Euler published De fractionibus continuis dissertatio [An essay on continued fractions]. (A very readable English translation is available.)
In 1748 Euler published a theorem showing that a particular kind of continued fraction is equivalent to a certain very general infinite series. Euler's continued fraction formula is still the basis of many modern proofs of convergence of continued fractions.
In 1761, Johann Heinrich Lambert gave the first proof that π is irrational, by using the following continued fraction for tan x: \[\tan(x) = \cfrac{x}{1 + \cfrac{-x^2}{3 + \cfrac{-x^2}{5 + \cfrac{-x^2}{7 + {}\ddots}}}}\]
Continued fractions can also be applied to problems in number theory, and are especially useful in the study of Diophantine equations. In the late eighteenth century Lagrange used continued fractions to construct the general solution of Pell's equation, thus answering a question that had fascinated mathematicians for more than a thousand years. Lagrange's discovery implies that the canonical continued fraction expansion of the square root of every non-square integer is periodic and that, if the period is of length p > 1, it contains a palindromic string of length p − 1.
Condensed: the full section is in Wikipedia.
Notation
The long continued fraction expression displayed in the introduction is easy for an unfamiliar reader to interpret. However, it takes up a lot of space and can be difficult to typeset. So mathematicians have devised several alternative notations. Gottfried Leibniz sometimes used notation like \[\begin{aligned}x = b_0 + \dfrac{a_1}{b_1} {{}\atop+} \\[28mu]\ \end{aligned} \! \begin{aligned} \dfrac{a_2}{b_2} {{}\atop+} \\[2mu] \ \end{aligned} \! \begin{aligned}\dfrac{a_3}{b_3} {{}\atop+}\end{aligned} \! \begin{aligned}\\[2mu] \dfrac{a_4}{b_4} +\, \cdots. \end{aligned}\] An even more concise notation sets each nested fraction on the same line, indicating the nesting by dangling plus signs in the denominators \[x = b_0+ \frac{a_1}{b_1~\!+}\, \frac{a_2}{b_2~\!+}\, \frac{a_3}{b_3~\!+}\, \frac{a_4}{b_4~\!{+}} \cdots,\] or sometimes with the plus signs typeset to vertically align with the denominators but not under the fraction bars, \[x = b_0 + \frac{a_1}{b_1}{{}\atop+} \frac{a_2}{b_2}{{}\atop+} \frac{a_3}{b_3}{{}\atop+} \frac{a_4}{b_4}{{}\atop+} \cdots.\]
Pringsheim wrote a generalized continued fraction this way: \[x = b_0 + {{}\atop{\big|\!}}\! \frac{a_1}{\,b_1\,} \!{{\!\big|}\atop{}} + {{}\atop{\big|\!}}\! \frac{a_2}{\,b_2\,} \!{{\!\big|}\atop{}} + {{}\atop{\big|\!}}\! \frac{a_3}{\,b_3\,} \!{{\!\big|}\atop{}} + {{}\atop{\big|\!}}\! \frac{a_4}{\,b_4\,} \!{{\!\big|}\atop{}} + \cdots .\]
Carl Friedrich Gauss evoked the more familiar infinite product ∏ when he devised this notation: \[x = b_0 + \mathop{\mathrm K}_{i=1}^{\infty} \frac{a_i}{b_i}.\] Here, the "K" stands for Kettenbruch, the German word for "continued fraction". This is probably the most compact and convenient way to express continued fractions; however, it is not widely used by English typesetters. (Usually the K should be the same size as ∑ used for a sum or ∏ used for a product, but within this article K appears much smaller than those due to technical limitations.)
Some elementary considerations
Here are some elementary results that are of fundamental importance in the further development of the analytic theory of continued fractions.
Partial numerators and denominators
If one of the partial numerators an+1 is zero, the infinite continued fraction \[b_0 + \mathop{\mathrm K}_{i=1}^{\infty} \frac{a_i}{b_i}\] is really just a finite continued fraction with n fractional terms, and therefore a rational function of a1 to an and b0 to bn+1. Such an object is of little interest from the point of view adopted in mathematical analysis, so it is usually assumed that all ai ≠ 0. There is no need to place this restriction on the partial denominators bi.
The determinant formula
When the nth convergent of a continued fraction \[x_n = b_0 + \mathop{\mathrm K}_{i=1}^{n} \frac{a_i}{b_i}\] is expressed as a simple fraction xn = An/Bn we can use the determinant formula
to relate the numerators and denominators of successive convergents xn and xn − 1 to one another. The proof for this can be easily seen by induction.
The equivalence transformation
If {ci} = {c1, c2, c3, ...} is any infinite sequence of non-zero complex numbers we can prove, by induction, that \[b_0 + \cfrac{a_1}{b_1 + \cfrac{a_2}{b_2 + \cfrac{a_3}{b_3 + \cfrac{a_4}{b_4 + \ddots\,}}}} = b_0 + \cfrac{c_1a_1}{c_1b_1 + \cfrac{c_1c_2a_2}{c_2b_2 + \cfrac{c_2c_3a_3}{c_3b_3 + \cfrac{c_3c_4a_4}{c_4b_4 + \ddots\,}}}}\] where equality is understood as equivalence, which is to say that the successive convergents of the continued fraction on the left are exactly the same as the convergents of the fraction on the right.
The equivalence transformation is perfectly general, but two particular cases deserve special mention. First, if none of the ai are zero, a sequence {ci} can be chosen to make each partial numerator a 1: \[b_0 + \mathop{\mathrm K}_{i=1}^{\infty} \frac{a_i}{b_i} = b_0 + \mathop{\mathrm K}_{i=1}^{\infty} \frac{1}{c_i b_i}\] where c1 = 1/a1, c2 = a1/a2, c3 = a2/a1a3, and in general cn+1 = 1/an+1cn.
Second, if none of the partial denominators bi are zero we can use a similar procedure to choose another sequence {di} to make each partial denominator a 1: \[b_0 + \mathop{\mathrm K}_{i=1}^{\infty} \frac{a_i}{b_i} = b_0 + \mathop{\mathrm K}_{i=1}^{\infty} \frac{d_i a_i}{1}\] where d1 = 1/b1 and otherwise dn+1 = 1/bnbn+1.
These two special cases of the equivalence transformation are enormously useful when the general convergence problem is analyzed.
Notions of convergence
As mentioned in the introduction, the continued fraction \[x = b_0 + \mathop{\mathrm K}_{i=1}^{\infty} \frac{a_i}{b_i}\] converges if the sequence of convergents {xn} tends to a finite limit. This notion of convergence is very natural, but it is sometimes too restrictive. It is therefore useful to introduce the notion of general convergence of a continued fraction. Roughly speaking, this consists in replacing the \(\mathop{\mathrm K}\nolimits_{i = n}^\infty \tfrac{a_i}{b_i}\) part of the fraction by wn, instead of by 0, to compute the convergents. The convergents thus obtained are called modified convergents. We say that the continued fraction converges generally if there exists a sequence \(\{w_n^*\}\) such that the sequence of modified convergents converges for all \(\{w_n\}\) sufficiently distinct from \(\{w_n^*\}\). The sequence \(\{w_n^*\}\) is then called an exceptional sequence for the continued fraction. See Chapter 2 of Lorentzen & Waadeland (1992) for a rigorous definition.
There also exists a notion of absolute convergence for continued fractions, which is based on the notion of absolute convergence of a series: a continued fraction is said to be absolutely convergent when the series \[f = \sum_n \left( f_n - f_{n-1}\right),\] where \(f_n =\mathop{\mathrm K}\nolimits_{i = 1}^n \tfrac{a_i}{b_i}\) are the convergents of the continued fraction, converges absolutely. The Śleszyński-Pringsheim theorem provides a sufficient condition for absolute convergence.
Finally, a continued fraction of one or more complex variables is uniformly convergent in an open neighborhood Ω when its convergents converge uniformly on Ω; that is, when for every ε > 0 there exists M such that for all n > M, for all \(z \in \Omega\), \[|f(z) - f_n(z)| < \varepsilon.\]
Even and odd convergents
It is sometimes necessary to separate a continued fraction into its even and odd parts. For example, if the continued fraction diverges by oscillation between two distinct limit points p and q, then the sequence {x0, x2, x4, ...} must converge to one of these, and {x1, x3, x5, ...} must converge to the other. In such a situation it may be convenient to express the original continued fraction as two different continued fractions, one of them converging to p, and the other converging to q.
The formulas for the even and odd parts of a continued fraction can be written most compactly if the fraction has already been transformed so that all its partial denominators are unity. Specifically, if \[x = \mathop{\mathrm K}_{i=1}^{\infty} \frac{a_i}{1}\] is a continued fraction, then the even part xeven and the odd part xodd are given by \[x_\text{even} = \cfrac{a_1}{1+a_2-\cfrac{a_2a_3} {1+a_3+a_4-\cfrac{a_4a_5} {1+a_5+a_6-\cfrac{a_6a_7} {1+a_7+a_8-\ddots}}}}\] and \[x_\text{odd} = a_1 - \cfrac{a_1a_2}{1+a_2+a_3-\cfrac{a_3a_4} {1+a_4+a_5-\cfrac{a_5a_6} {1+a_6+a_7-\cfrac{a_7a_8} {1+a_8+a_9-\ddots}}}}\] respectively. More precisely, if the successive convergents of the continued fraction x are {x1, x2, x3, ...}, then the successive convergents of xeven as written above are {x2, x4, x6, ...}, and the successive convergents of xodd are {x1, x3, x5, ...}.
Conditions for irrationality
If a1, a2,... and b1, b2,... are positive integers with ak ≤ bk for all sufficiently large k, then \[x = b_0 + \mathop{\mathrm K}_{i=1}^{\infty} \frac{a_i}{b_i}\] converges to an irrational limit.
Fundamental recurrence formulas
The partial numerators and denominators of the fraction's successive convergents are related by the fundamental recurrence formulas: \[\begin{aligned} A_{-1}& = 1& B_{-1}& = 0\\ A_0& = b_0& B_0& = 1\\ A_{n+1}& = b_{n+1} A_n + a_{n+1} A_{n-1}& B_{n+1}& = b_{n+1} B_n + a_{n+1} B_{n-1} \end{aligned}\]
The continued fraction's successive convergents are then given by \[x_n=\frac{A_n}{B_n}.\]
These recurrence relations are due to John Wallis (1616-1703) and Leonhard Euler (1707-1783). These recurrence relations are simply a different notation for the relations obtained by Pietro Antonio Cataldi (1548-1626).
As an example, consider the simple continued fraction in canonical form that represents the golden ratio φ: \[\varphi = 1 + \cfrac{1}{1 + \cfrac{1}{1 + \cfrac{1}{1 + \cfrac{1}{1 + \ddots\,}}}}\]
Applying the fundamental recurrence formulas we find that the successive numerators An are {1, 2, 3, 5, 8, 13, ...} and the successive denominators Bn are {1, 1, 2, 3, 5, 8, ...}, the Fibonacci numbers. Since all the partial numerators in this example are equal to one, the determinant formula assures us that the absolute value of the difference between successive convergents approaches zero quite rapidly.
Linear fractional transformations
A linear fractional transformation (LFT) is a complex function of the form \[w = f(z) = \frac{az + b}{cz + d},\] where z is a complex variable, and a, b, c, d are arbitrary complex constants such that cz + d ≠ 0. An additional restriction that ad ≠ bc is customarily imposed, to rule out the cases in which w = f(z) is a constant. The linear fractional transformation, also known as a Möbius transformation, has many fascinating properties. Four of these are of primary importance in developing the analytic theory of continued fractions.
- If c ≠ 0 the LFT has one or two fixed points. This can be seen by considering the equation \[f(z) = z \Rightarrow az + b = cz^2 + dz \Rightarrow cz^2 + (d-a)z - b = 0 ,\] which is clearly a quadratic equation in z. The roots of this equation are the fixed points of f(z). If the discriminant (d − a) + 4bc is zero the LFT fixes a single point; otherwise it has two fixed points.
- If ad ≠ bc the LFT is an invertible conformal mapping of the extended complex plane onto itself. In other words, this LFT has an inverse function \[z = g(w) = \frac{\phantom{+}dw - b}{-cw + a}\] such that f(g(z)) = g(f(z)) = z for every point z in the extended complex plane, and both f and g preserve angles and shapes at vanishingly small scales. From the form of z = g(w) we see that g is also an LFT.
- The composition of two different LFTs for which ad ≠ bc is itself an LFT for which ad ≠ bc. In other words, the set of all LFTs for which ad ≠ bc is closed under composition of functions. The collection of all such LFTs, together with the "group operation" composition of functions, is known as the automorphism group of the extended complex plane.
- If a = 0 the LFT reduces to \[w = f(z) = \frac{b}{cz + d},\] which is a very simple meromorphic function of z with one simple pole (at −d/c) and a residue equal to b/c. (See also Laurent series.)
The continued fraction as a composition of LFTs
Consider a sequence of simple linear fractional transformations \[\begin{aligned} \tau_0(z) &= b_0 + z, \\[4px] \tau_1(z) &= \frac{a_1}{b_1 + z}, \\[4px] \tau_2(z) &= \frac{a_2}{b_2 + z},\\[4px] \tau_3(z) &= \frac{a_3}{b_3 + z},\\&\;\vdots \end{aligned}\]
Here we use τ to represent each simple LFT, and we adopt the conventional circle notation for composition of functions. We also introduce a new symbol Τn to represent the composition of n + 1 transformations τi; that is, \[\begin{aligned} \boldsymbol{\Tau}_\boldsymbol{1}(z) &= \tau_0\circ\tau_1(z) = \tau_0\big(\tau_1(z)\big),\\ \boldsymbol{\Tau}_\boldsymbol{2}(z) &= \tau_0\circ\tau_1\circ\tau_2(z) = \tau_0\Big(\tau_1\big(\tau_2(z)\big)\Big), \end{aligned}\] and so forth. By direct substitution from the first set of expressions into the second we see that \[\begin{aligned} \boldsymbol{\Tau}_\boldsymbol{1}(z)& = \tau_0\circ\tau_1(z)& =&\quad b_0 + \cfrac{a_1}{b_1 + z}\\[4px] \boldsymbol{\Tau}_\boldsymbol{2}(z)& = \tau_0\circ\tau_1\circ\tau_2(z)& =&\quad b_0 + \cfrac{a_1}{b_1 + \cfrac{a_2}{b_2 + z}} \end{aligned}\] and, in general, \[\boldsymbol{\Tau}_\boldsymbol{n}(z) = \tau_0\circ\tau_1\circ\tau_2\circ\cdots\circ\tau_n(z) = b_0 + \mathop{\mathrm K}_{i=1}^{n} \frac{a_i}{b_i}\] where the last partial denominator in the finite continued fraction K is understood to be bn + z. And, since bn + 0 = bn, the image of the point z = 0 under the iterated LFT Τn is indeed the value of the finite continued fraction with n partial numerators: \[\boldsymbol{\Tau}_\boldsymbol{n}(0) = \boldsymbol{\Tau}_\boldsymbol{n+1}(\infty) = b_0 + \mathop{\mathrm K}_{i=1}^{n} \frac{a_i}{b_i}.\]
ตอนนี้คุณ ไม่มีเครื่องคิดเลขที่จะคำนวณคำถามนี้ได้ แต่บางส่วนของคำถามนี้สามารถคำนวณได้ ลองใช้ตัวอย่างด้านล่างนี้ หรือพิมพ์คำถามของคุณเอง
สัญลักษณ์ที่ใช้ที่นี่
คลิกสัญลักษณ์ใดก็ได้ เพื่อดูคำอธิบาย รูปภาพ และความหมายของตัวอักษร
คำถามที่คนถาม
Why are primes so important?
Every integer factors into primes in exactly one way, so primes are the atoms of multiplication. Cryptography relies on that factoring being easy to state and hard to do.
How do I tell whether a big number is prime?
Trial division up to the square root works for small numbers. For large ones, probabilistic tests (Miller-Rabin) give an answer that is wrong with negligible probability, and deterministic tests (AKS) exist but are slower.
ส่วนหนึ่งของหน้านี้ถูกปรับแต่งจาก Wikipedia (CC BY-SA 4.0). คำอธิบายที่อธิบายใหม่ ความผิดพลาดเป็นของเรา
เพิ่มเติมใน Number Theory
Prime factorisationPrime numbersGCD and LCMModular arithmeticDivisorsSequencesNumber basesDiophantine equationsFermat's little theorem and Euler's theoremRSA: cryptography from number theory