I know that it is possible to make a CF (continued fraction) for every number that is a solution of a quadratic equation but I don't know how.
The number I'd like to write as a CF is:
$\frac{1 - \sqrt 5}{2}$
How do I tackle this kind of problem?
I know that it is possible to make a CF (continued fraction) for every number that is a solution of a quadratic equation but I don't know how.
The number I'd like to write as a CF is:
$\frac{1 - \sqrt 5}{2}$
How do I tackle this kind of problem?
The general procedure is as follows for positive $x$. Let $x_0=x$, and let $[a_0;a_1,a_2,\dots]$ be the desired CF expansion. Then $a_0=\lfloor x_0\rfloor$. Given $x_n$ and $a_n$, let $x_{n+1}=\frac1{x_n-a_n}$ and $a_{n+1}=\lfloor x_{n+1}\rfloor$.
Since $\frac12(1-\sqrt5)$ is negative, let’s work with its absolute value, $x=\frac12(\sqrt5-1)$. Clearly $0\le x<1$ so $a_0=0$. Then $x_1=\frac1x=\frac2{\sqrt5-1}=\frac{2(\sqrt5+1)}4=\frac{1+\sqrt5}2\;;$ so $\lfloor x_1\rfloor=\left\lfloor\frac{1+\sqrt5}2\right\rfloor=1\;,$ since $2\le\sqrt5<3$, and $a_1=1$.
Now $x_2=\frac1{x_1-1}=\frac2{\sqrt5-1}=x_1\;,$ so everything repeats: $a_2=1$, $x_3=x_1$, $a_3=1$, etc. Thus, $x=[0;1,1,1,\dots]$, and your number is the negative of this.
Suppose $x$ is a root of $p(z) = z^2 - b z - c$. Then, diving $p(z)$ over $z$ and solving that for $z$ gets us $ z = b+ \frac{c}{z} $ Iterating: $ z = b + \cfrac{c}{b + \cfrac{c}{z}} = \cfrac{b}{c + \cfrac{c}{b+ \ddots}} $ Since $\frac{1-\sqrt{5}}{2}$ is a root of $z^2 - z -1$ we have: $ \frac{1-\sqrt{5}}{2} = -\frac{1}{\frac{1+\sqrt{5}}{2}} = - \cfrac{1}{1 + \cfrac{1}{1+ \frac{1}{1+\ddots}}} $
Let's rewrite $\ \dfrac {1-\sqrt{5}}2=-1+\dfrac {3-\sqrt{5}}2$ to have something positive to evaluate then : $\frac 1{\dfrac {3-\sqrt{5}}2}=\frac 2{3-\sqrt{5}}=\frac {2(3+\sqrt{5})}{(3-\sqrt{5})(3+\sqrt{5})}=\frac {2(3+\sqrt{5})}{9-5}=\frac {3+\sqrt{5}}{2}=2+\frac {\sqrt{5}-1}{2}$ (we want the term at the right to be between $0$ and $1$ at each stage)
You may continue this process until repetition !
You should get : $\dfrac {1-\sqrt{5}}2=-1+\cfrac 1{2+\cfrac 1{1+\cfrac 1{1+\ddots}}}$