# Going from Infinite Continued Fraction to real numbers

I have been given the infinite continued fraction of $\left[12, 2, 2, 12,\dots\right]$ where the first 12 is the natural number part and the remaining numbers repeat. I am familiar with how to convert real numbers into continued fractions, but I am stuck as to how to convert a continued fraction into a real number. I know that since this is infinite, it must be a irrational number, so it must be a $\sqrt{n}$ or $a + \sqrt{n}$. What is a good way to start approaching this question? Thank you.

• Start with a simpler example like $[1; 2, 2, 2, \ldots]$. If you call this $x$ then by partially writing out the definition of the continued fraction you can see that $x = 1 / (1 + [1; 2, 2, 2, \ldots]) = 1/(1+x)$. Solving this gives you a quadratic equation in $x$ which lets you narrow it down to one of two possibilities. You can further decide which of the two is $x$ by bounding the value of $x$ (for instance, it's easy to see in this case that $1 < x < 2$). Commented Nov 26, 2017 at 7:11

Hint: Call the value $x$. Subtract $12$, invert, subtract $2$, invert, subtract $2$, and invert. You get $x$ back again.

Write this down and solve for $x$.

$$x = \frac1{\frac1{\frac1{x-12}-2}-2}$$

Edit (almost 7 years later): I now know of a different way to solve such problems; so, I thought I'd provide an update! I wrote about the magic box in The Aperiodical (link) and thought it would be worthwhile to apply it for your problem:

The final convergent given is equal to the expression about which you have asked; let us denote it as $$y$$. Next, we can proceed by solving the quadratic equation:

$$\frac{62y + 25}{5y + 2} = y$$

You could do this by hand, but I outsourced it to WolframAlpha: $$y = 6 + \sqrt{41}$$

You can then ask WolframAlpha to compute the continued fraction for this value of $$y$$, and you will see that it returns the result of $$[12, 2, 2, 12, 2, 2, 12, \ldots]$$ as desired. (WA computation)

Original response (from 2017): Another approach (I'm not sure if your first comma was intended to be a semicolon; in any event, you can modify slightly if your notation represents something different from the equations below, but the method is roughly the same):

If I am understanding your notation correctly, then you are considering the continued fraction:

Because of the repetition, this could be rewritten as:

Now, you have an equation with one variable. In trying to solve for $$x$$, you will come to see that this is a quadratic equation; thus, two possible solutions will arise. However, one of them will be negative and the other one will be positive. Since your constructed number is manifestly positive, you'll want the latter.

• You could really use some math latex to normalize the fonts ^_^ Commented Nov 26, 2017 at 7:14
• @GaurangTandon Be the change. Commented Nov 26, 2017 at 7:15
• I guess I'm better off being lazy :P Commented Nov 26, 2017 at 7:16
• @GaurangTandon I'm not convinced $\LaTeX$ would make this more readable. Although, I did write "$x$" in the final paragraph... Commented Nov 26, 2017 at 7:17
• Fine, I am very much used to only seeing latex math on this site. So, this handdrawn image of maths came as a surprise. Commented Nov 26, 2017 at 7:19