# Number TheoryContinued fraction

#### Poirot

##### Banned
Find the value of the continued fraction $1$+$\frac{1}{1+\frac{1}{2+\frac{1}{1+\frac{1}{2+...}}}}$
and use it to find two positive solutions to pell's equation $x^2-3y^2=1$

Last edited by a moderator:

#### chisigma

##### Well-known member
Find the value of the continued fraction $1$+$\frac{1}{\frac{1+\frac{1}{2+\frac{1}{1+\frac{1}{2+...}}$
and use it to find two positive solutions to pell's equation $x^2-3y^2=1$
Let's suppose that You have to find a continued fraction expansion of $\displaystyle \sqrt{3}$ starting from the first step...

$\displaystyle \sqrt{3} = 1 + \frac{1}{x_{1}}$ (1)

Solving (1) respect to $x_{1}$ You obtain...

$\displaystyle x_{1} = \frac{\sqrt{3}+1}{2} = 1 + \frac{1}{x_{2}}$ (2)

Solving (2) respect to $x_{2}$ You obtain...

$\displaystyle x_{2}= \sqrt{3}+1 = 2 + \frac{1}{x_{1}}$ (3)

Now comparing (1),(2) and (3) You can conclude that...

$\displaystyle \sqrt{3}= 1 + \frac{1}{1 + \frac{1}{2 + ...}}$ (4)

Kind regards

$\chi$ $\sigma$

#### Poirot

##### Banned
The code's not working so you have the wrong fraction

#### soroban

##### Well-known member
Hello, Poirot!

Here is part of the solution.

Find the value of the continued fraction

$$x \;=\;1 + \dfrac{1}{1+\dfrac{1}{2 + \dfrac{1}{1+\dfrac{1}{2+...}}}}$$
We have:

$x-1 \;=\;\dfrac{1}{1+\dfrac{1}{2 + \left\{\dfrac{1}{1+\dfrac{1}{2+...}}\right\}}}$

The expression in braces is $$x-1.$$

So we have:

. . $$x-1 \;=\;\dfrac{1}{1 + \dfrac{1}{2+(x-1)}}$$

. . $$x-1 \;=\;\dfrac{1}{1+\dfrac{1}{x+1}}$$

. . $$x-1 \;=\;\dfrac{1}{\dfrac{x+2}{x+1}}$$

. . $$x-1 \;=\;\dfrac{x+1}{x+2}$$

Then:

. . $$(x-1)(x+2) \:=\:x+1$$

. . . . .$$x^2 + x - 2 \:=\:x+1$$

. . . . . . . . . . $$x^2 \:=\:3$$

. . . . . . . . . . .$$x \;=\;\sqrt{3}$$

#### Poirot

##### Banned
Thanks 'Soroban'. For the last bit, is there a good formula for the convergents?