<s>[INST] Only valid for Pythagoraean triples $\sqrt2+\frac{b}{\sqrt2+\frac{b}{\sqrt2+\frac{b}{\sqrt2\cdots}}}=\sqrt{c+a}$? $$\sqrt2+\frac{b}{\sqrt2+\frac{b}{\sqrt2+\frac{b}{\sqrt2\cdots}}}=\sqrt{c+a}$$
Where (a,b,c) are the Pythagoraean Triples and are satisfy by the Pythagoras theorem $a^2+b^2=c^2$
An example of Pythagoraean triple (3,4,5)
It is true that this continued fraction is only valid for Pythagoraean Triple only?
I try other numbers and it seem that the only numbers that are valid are the Pythagoraean Triples. Can anyone verify this? Or show some examples where is also work for other numbers.
 [/INST] Solving the Recurrence
Let 
$$
x = \sqrt 2 + \frac{b}{x} 
$$
Hence,
$$
x = \frac{\sqrt 2 x + b}{x} \implies x^2 = \sqrt 2 x + b \\
x^2 - x\sqrt2 - b = 0
$$
The roots of this equation are
$$
x_1, x_2 = \frac{\sqrt2 \pm \sqrt{ \sqrt{2}^2 + 4b}}{2} = \frac{\sqrt{2} \pm \sqrt{2  +4b}}{2}
$$
Proving that this works for all Pythogaren triplets
Let us consider the always-positive root
$$x_1 = \frac{ \sqrt{2} + \sqrt{2 + 4b} }{2}$$
Let us first compute $x_1^2$ and produce Pythogorean triplets:
$$
x_1^2 = \left (\frac{ \sqrt{2} + \sqrt{2 - 4b} }{2} \right)^2= \\
\frac{2 + (2 + 4b) + 2 \cdot \sqrt 2 \cdot \sqrt{2 + 4b}}{4} = \\
\frac{4 + 4b + 2 \cdot \sqrt 2 \cdot \sqrt 2 \sqrt{1 + 2b}}{4}
\\
\\
x_1^2 = 1 + b + \sqrt{1 + 2b}
$$
We want $x_1 = \sqrt{a + c}$, so we pick $a = \sqrt{1 + 2b}$, $c = 1 + b$
that gives us
$$
a^2 + b^2 = \sqrt{1 + 2b}^2 + b^2 = \\
1 + 2b + b^2 \\
= (1 + b)^2 \\
= c^2
$$
which verifies that the Pythogarean triplets $(a, b, c)$ satisfy this equation.
Non Pythogaren triplet integer solutions
Since we know that
$$
x_1^2 = 1 + b + \sqrt{1 + 2b}
$$
We can pick $a = 1 + \sqrt{1 + 2b}$, $c = b$ Giving us non-triplet numbers. It can be seen that this can never be a pythogarean triplet by seeing that
$$
b^2 = b^2 \\
c^2 = c^2 \\
a^2 = 1 + (1 + 2b) + 2 . 1 . \sqrt{1 + 2b}
$$
Which cannot be re-arranged into a triplet.
However, they are still integer solutions such that
$x1 = \sqrt{a + c}$ for a given $b$.
</s>