Solution for continued fraction

481 Views Asked by At

To solve the finite continued fraction $[2,....,2]$, can I use this solution.

Let $y$ be the value of $[2,....,2]$. Then $y=[2;y]=2+\frac{1}{y}$.

So $y-2=\frac{1}{y}$. Thus $y^2-2y-1=0$

My question is is my method correct. Is this approach suitable to solve $[2,....,2]$

2

There are 2 best solutions below

2
On

No, this is only valid for the infinite continued fraction.

If the continued fraction has a finite length (say, length $5$), then

$$y = 2 + \frac1{2 + \frac1{2 + \frac1{2 + \frac12}}} \ne 2 + \frac1y = 2 + \frac1{2 + \frac1{2 + \frac1{2 + \frac1{2 + \frac12}}}}.$$

The same thing happens for any length.

Instead, you can just compute the fraction for $y$ recursively: You have $[2] = 2$, $[2;2] = 2+\frac12 = \frac32$, $[2;2,2] = 2 + \frac1{3/2} = \frac53$, and in general, if you got $y_n$ for $n$ $2$'s, then you get $y_{n+1} = 2 + \frac1{y_n}$.

5
On

Is this approach suitable to solve $[2,....,2]$

No, because your continued fraction is finite. Moreover, it is rational and the solutions of $y^2-2y-1=0$ are irrational.

Notation. \begin{equation*} x_{n}=a_0+\cfrac{1}{a_1+\cfrac{1}{\begin{array}{ccc}a_{2}+ & & \\& \ddots & \\& & +\cfrac{1}{a_{n-1}+\cfrac{1}{a_{n}}}\end{array}}}= \left[ a_{0};a_{1},a_{2},\ldots ,a_{n}\right] =[2;\underset{n\text{ elements}}{\underbrace{2,\ldots ,2}}]=\frac{p_{n}}{q_{n}}. \end{equation*} We then have $x_{0}=[a_{0}]=\frac{p_{0}}{q_{0}}=\frac{a_{0}}{1}=\frac{2}{1}$ with $(p_{0},q_{0})=(2,1)$; and $x_{1}=\left[ a_{0};a_{1}\right] =\frac{p_{1}}{q_{1} }=a_{0}+\frac{1}{a_{1}}=\frac{a_{0}a_{1}+1}{a_{1}}=\frac{5}{2}$; with $ (p_{1},q_{1})=(5,2)$.

For $n\geq 2$ the integers $p_{n},q_{n}$ satisfy the fundamental recurrent relation \begin{eqnarray*} p_{n} &=&a_{n}p_{n-1}+p_{n-2}=2p_{n-1}+p_{n-2}, \\ q_{n} &=&a_{n}q_{n-1}+q_{n-2}=2q_{n-1}+q_{n-2}. \end{eqnarray*} The next two terms of the finite sequence $(x_n)$ are \begin{eqnarray*} x_{2} &=&\left[ a_{0};a_{1},a_{2}\right] =a_{0}+\frac{1}{a_{1}+1/a_{2}}= \frac{p_{2}}{q_{2}}=\frac{2p_{1}+p_{0}}{2q_{1}+q_{0}}=\frac{2(5)+2}{2(2)+1}= \frac{12}{5}, \\ x_{3} &=&\left[ a_{0};a_{1},a_{2},a_{3}\right] =a_{0}+\frac{1}{ a_{1}+1/(a_{2}+1/a_{3})}=\frac{p_{3}}{q_{3}}=\frac{2p_{2}+p_{1}}{2q_{2}+q_{1} }=\frac{2(12)+5}{2(5)+2}=\frac{29}{12}, \\ &&\cdots \end{eqnarray*}

and \begin{equation*} (p_{2},q_{2})=(12,5),(p_{3},q_{3})=(29,12),\ldots . \end{equation*}