finding the rational number which the continued fraction $[1;1,2,1,1,2,\ldots]$ represents I'd really love your help with finding the rational number which the continued fraction $[1;1,2,1,1,2,\ldots]$ represents.
With the recursion for continued fraction $( p_0=a_0, q_0=1, p_{-1}=1, q_{-1}=o), q_s=a_sq_{s-1}+q_{s-2},p_s=a_sp_{s-1}+p_{s-2}$. I found out the $p_k=1,2,5,7,12,32, q_k=1,1,3,4,7,18 $ (anything special about these series? perhaps I did a mistake?), and I know that $r=\lim_{c_k}=\lim\frac{p_k}{q_k}$, but I can't see anything special about $p_k, q_k$ or the realtion between them, Any help?
Thanks a lot!
 A: We have that 
$$\Large x=1+\frac{1}{1+\frac{1}{2\,+\,\frac{1}{1\,+\,\frac{1}{1\,+\,\frac{1}{2\,+\,\cdots}}}}}=1+\frac{1}{1+\frac{1}{2+\frac{1}{x}}}$$
so that 
$$\frac{1}{x-1}=1+\frac{1}{2+\frac{1}{x}}$$
hence
$$\frac{1}{\frac{1}{x-1}-1}=\frac{1}{\frac{1}{x-1}-\frac{x-1}{x-1}}=\frac{1}{\frac{2-x}{x-1}}=\frac{x-1}{2-x}=2+\frac{1}{x}$$
and thus
$$x^2-x=2x(2-x)+(2-x)$$
$$x^2-x=-2x^2+4x+2-x$$
$$3x^2-4x-2=0$$
The roots of this equation are
$$x=\frac{4\pm\sqrt{40}}{6}=\frac{4\pm 2\sqrt{10}}{6}$$
but we know it can't be $x=\frac{4-2\sqrt{10}}{6}$ since that number is negative, so we can conclude that $x=\frac{4+2\sqrt{10}}{6}$. Note that this number is not rational.
A: It's not rational if its simple continued fraction expansion repeats rather than terminating.
If you mean this:
$$
1+\cfrac{1}{1+\cfrac{1}{2+\cfrac{1}{1+\cfrac{1}{1+\cfrac{1}{2+ \cdots}}}}}
$$
with $1,1,2$ repeating forever, then look at it like this:
$$
x = 1+\cfrac{1}{1+\cfrac{1}{2+\cfrac{1}{\left( 1+\cfrac{1}{1+\cfrac{1}{2+ \cdots}}\right)}}} = 1+\cfrac{1}{1+\cfrac{1}{2+\cfrac{1}{x}}}.
$$
You then have
$$
x = 1+\cfrac{1}{1+\cfrac{1}{2+\cfrac{1}{x}}}.
$$
Simplify the fraction and you've got a quadratic equation that you can solve for $x$.
A: Since this continued fraction is infinite,this can't be a rational number(it is surely an irrational number).For more details, http://en.wikipedia.org/wiki/Continued_fraction
