- Introduction
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 part another reciprocal, and so on. In a finite fraction, the iteration is terminated after finitely many steps by using an integer in lieu of another continued fraction. In contrast, an infinite continued fraction is an infinite expression. In either case, all integers in the sequence, other than the first, must be positive. The integers $a_i$ called the coefficients or terms of the continued fraction.
It is generally assumed that the numerator of all the fractions is 1. If arbitrary values and/or functions are used in place of one or more numerators or integers in the denominators, the resulting expression is a generalized continued fraction. When it is necessary to distinguish the first form of generalized fractions, the former may be called simple or regular continued fractions or said to be in a canonical form.
Continued fractions have a number of remarkable properties related to the Euclidean algorithm for integers or real numbers. Every rational number $\frac{p}{q}$ has two closely related expressions as a finite continued fraction, whose coefficients $a+i$ can be determined by applying the Euclidean algorithm to $(p,q)$. The numerical value of an infinite continued fraction is irrational; it is defined from its infinite sequence of integers as the limit of a sequence of values for finite continued fractions. Each finite continued fraction of the sequence is obtained by using a finite prefix of the infinite continued fraction’s defining sequence of integers. Moreover, every irrational number a is the value of a unique infinite regular continued fraction, whose coefficients can be found using the non-terminating version of the Euclidean algorithm applied to the incommensurable values $\alpha$ and 1. This way of expressing real numbers (rational and irrational) is called their continued fraction representation.
- Generalized continued fraction
The term "continued fraction" is used to refer to a class of expressions in which a generalized continued fraction of the form. $$a_0+\frac{b_1}{a_1+\frac{b_2}{a_2+\frac{b_3}{a3+\cdots}}}$$
(and the terms may be integers, reals, complexes, or functions of these) are the most general variety.
Wallis first used the term "continued fraction" in his Arithmetica infinitorum of 1653 \cite{Havil2003}, , although other sources list the publication date as 1655 or 1656. An archaic word for a continued fraction is anthyphairetic ratio.
- Simple Continued Fractions
A simple continued fraction is a special case of a generalized continued fraction for which the partial numerators are equal to unity, i.e., $b_n=1$ for all $n=1, 2, ....$. A simple continued fraction is therefore an expression of the form
$$a_0+\frac{1}{a_1+\frac{1}{a_2+\frac{1}{a3+\cdots}}}$$
When used without qualification, the term "continued fraction" is often used to mean "simple continued fraction" or, more specifically, regular (i.e., a simple continued fraction whose partial denominators $a_0, a_1, ...$ are positive integers;. The number of terms can either be finite or infinite. A more convenient way to denote continued fractions such as the one above would be to denote it by $N=[a_0,a_1,a_2,a_3,a_4,a_5,a_6,\cdots]$
- Finite Continued Fractions
A finite continued fraction is an expression such as the one shown above which could end. Every rational number can be equated to a finite continued fraction. The only skill needed would be the division of fractions.
$$\frac{47}{17}=2+\frac{13}{17}=2+\frac{1}{\frac{17}{13}}=2+\frac{1}{1+\frac{4}{13}}=2+\frac{1}{1+\frac{1}{\frac{13}{4}}}=2+\frac{1}{1+\frac{1}{3+\frac{1}{4}}}$$ In the short form, $\frac{47}{17}=[2;1,3,4]$
- Infinite Continued Fractions
Unlike finite continued fractions, the chain of fractions never ends in an infinite continued fraction. Every irrational number can be equated to an infinite continued fraction. This fact was discovered and proven by the Swiss Mathematician, Leonhard Euler (1707-1783). Some of Euler’s infinite continued fractions are as we will see below: $$\sqrt{2}=1+\frac{1}{2+\frac{1}{2+\frac{1}{2+\cdots}}}$$ A way to summarise this expression is to let $x$ be the value of the continued fraction. $$x=1+\frac{1}{2+\frac{1}{2+\frac{1}{2+\cdots}}}\Leftrightarrow x=1+\frac{1}{1+x}$$
\subsection*{Solving quadratic equations with continued fractions} In mathematics, a quadratic equation is a polynomial equation of the second degree. The general form is $ax^{2}+bx+c=0$, where $a \neq 0$.
The quadratic equation on a number $x$ can be solved using the well-known quadratic formula, which can be derived by completing the square. That formula always gives the roots of the quadratic equation, but the solutions are expressed in a form that often involves a quadratic irrational number, which is an algebraic fraction that can be evaluated as a decimal fraction only by applying an additional root extraction algorithm.
If the roots are real, there is an alternative technique that obtains a rational approximation to one of the roots by manipulating the equation directly. The method works in many cases, and long ago it stimulated further development of the analytical theory of continued fractions. \cite{Wall1948}
Joseph-Louis Lagrange (1736-1813) proved that the continued fraction expansion of a real number $x$ is ultimately periodic, i.e, $$x=[a_0,...a_k, b_1,...,b_h,b_1,...,b_h]$$
in ways similar to how it is done for repeating decimals.
- Example *** Here is a simple example to illustrate the solution of a quadratic equation using continued fractions. We begin with the equation $x^2=2$ and manipulate it directly. Subtracting one from both sides we obtain $x^2-1=1$. This is easily factored into $(x+1)(x-1)=1$ from which we obtain $ (x-1)={\frac {1}{1+x}}$ and finally $ x=1+{\frac {1}{1+x}}$. Now comes the crucial step. We substitute this expression for $x$ back into itself, recursively, to obtain $$ x=1+{\cfrac {1}{1+\left(1+{\cfrac {1}{1+x}}\right)}}=1+{\cfrac {1}{2+{\cfrac {1}{1+x}}}}.$$ But now we can make the same recursive substitution again, and again, and again, pushing the unknown quantity x as far down and to the right as we please, and obtaining in the limit the infinite continued fraction
$$x=1+{\cfrac {1}{2+{\cfrac {1}{2+{\cfrac {1}{2+{\cfrac {1}{2+{\cfrac {1}{2+\ddots }}}}}}}}}}={\sqrt {2}}.$$ Hence the continued fraction expansion of $\sqrt2$ is given by $$\sqrt{2}=[1,2,2,2,...]$$.
By applying the fundamental recurrence formulas, we may easily compute the successive convergent of this continued fraction to be 1, 3/2, 7/5, 17/12, 41/29, 99/70, 239/169, ..., where each successive convergent is formed by taking the numerator plus the denominator of the preceding term as the denominator in the next term, then adding in the preceding denominator to form the new numerator. This sequence of denominators is a particular Lucas sequence known as the Pell numbers.
Continued fractions play an essential role in the solution of Pell's equation. For example, for positive integers $p$ and $q$, and non-square $n$, it is true that if $p^2-nq^2=\pm1$ , then $\frac{p}{q}$ is a convergent of the regular continued fraction for $\sqrt{n}$. The converse holds if the period of the regular continued fraction for$\sqrt{n}$ is 1, and in general the period describes which convergent gives solutions to Pell's equation.
- Problem ***
Let's consider the continued fraction below
A continued fraction is a fraction whose numerator is an integer and whose denominator is an integer added to a fraction whose numerator is an integer and whose denominator is an integer added to a fraction, and so on.
$$1+\frac{1}{1+\frac{1}{1+\frac{1}{1+\frac{1}{1+\frac{1}{...}}}}},$$
First, we will create a formula that expresses the above expression as a sequence. Second, we will calculate the first ten terms of the sequence that have been created and represent it graphically. We will also try to calculate the 200th term of the sequence and finally, Finally, we will study the "connection" that continued fractions have with the quadratic equation.
We can write this "infinite fraction" as a sequence of terms, $t_n$, where
So, if we determinate a generalized formula for $t_{n+1}$ in terms of $t_n$, we have the following formula $$t_{n+1}=1+\frac{1}{t_n}$$ Now, let's compute the decimal equivalents of the first 10 terms.
Clear[t]
t[0] = 1;
t[n_] := 1 + 1/t[n - 1];
terms = Table[t[n], {n, 0, 10}]
terms // N
- $t_0=1.000$
$t_1=1+1=2.000$
$t_2=1+\frac{1}{1+1}=1+\frac{1}{2}=\frac{3}{2}=1.500$
$t_3=1+\frac{1}{1+\frac{1}{1+1}}=1+\frac{1}{\frac{3}{2}}=1+\frac{2}{3}=\frac{5}{3}=1.666$
$t_4=1+\frac{1}{\frac{5}{3}}=1+\frac{3}{5}=\frac{8}{5}=1.600$
$t_5=1+\frac{1}{\frac{8}{5}}=1+\frac{5}{8}=\frac{13}{8}=1.625$
$t_6=1+\frac{1}{\frac{13}{8}}=1+\frac{8}{13}=\frac{21}{13}\simeq 1.615$
$t_7=1+\frac{1}{\frac{21}{13}}=1+\frac{13}{21}=\frac{34}{21}\simeq 1.619$
$t_8=1+\frac{1}{\frac{34}{21}}=1+\frac{21}{34}=\frac{55}{34}\simeq 1.618$
$t_9=1+\frac{1}{\frac{55}{34}}=1+\frac{34}{55}=\frac{89}{55}\simeq 1.618$
$t_{10}=1+\frac{1}{\frac{89}{55}}=1+\frac{55}{89}=\frac{144}{89}\simeq 1.618$
As the graph below shows, from the $8^{th}$ term onwards, all terms converge to 1.618
ListLinePlot[{1.0000, 2.0000, 1.5000, 1.6666, 1.6000, 1.6250, 1.6153, 1.6190, 1.6176, 1.6181, 1.6179}]
Plot[terms, {n, 0, 10}, PlotLegends -> "Expressions"]
We are able to notice that, when n gets very large the terms tend to be 1.618.
Now, If we want to determine for example the 200th term, we will notice that our main problem is that we have to calculate all the previous terms until we reach the 200th, which is also time-consuming. Another important problem is that from the table above, we could assume that since the terms from the 7th onwards are at 1.618, the 200th term also tends to 1.618. But this is not proof.