# Can Every Irrational, but Non-Transcendental be Expressed as a Repeating Continued Fraction?

So, as far as I understand any rational number can be expressed as a continued fraction of finite length

for example: $$\frac {7}{17} = \cfrac {1}{2 + \cfrac{1}{2 + \cfrac{1}{3}}}$$ which for convenience I will express as $$[0,2,2,3]$$

Now I also understand that some irrationals can be written as infinite continued fractions $$\sqrt{2} =1 + \cfrac{1}{2 +\cfrac{1}{2 + \cfrac{1}{\cdots}}}$$ expressable as $$[1,\overline{2}]$$

Now my question, can all irrational numbers that can be expressed as the root of a polynomial (algebraic irrational) be expressed as a repeating continued fraction? How would we go about proving this if it is true?

• Every algebraic irrational, yes. – barak manos Nov 20 '16 at 17:23
• no. repeating c.f. means a quadratic irrational, real root of $a x^2 + b x + c$ with integers $a,b,c.$ More restrictions if the c.f. is strictly periodic – Will Jagy Nov 20 '16 at 17:26
• To simplify every answer here: NO, unless the number happens to be the root of a quadratic. – Brevan Ellefsen Nov 20 '16 at 18:02

If a simple continued fraction repeats but does not terminate then it converges to a second-degree algebraic number. ("Simple" means all of the numertors are $$1$$.)
First, look at the case where the repeating part begins immediately: $$x = a_1 + \cfrac 1 {a_2 + \cfrac 1 {a_3 + \cfrac 1 {\ddots \cfrac{}{a_n + \cfrac 1 {a_1 + _{\large\ddots}}}}}}$$ Then you have $$x = a_1 + \cfrac 1 {a_2 + \cfrac 1 {a_3 + \cfrac 1 {\ddots \cfrac{}{a_n + \cfrac 1 x}}}}$$ This reduces to a quadratic equation in $$x$$ with integer coefficients.
To to that reduction to a quadratic equation, start with $$a_{n-1} + \cfrac 1 {a_n + \cfrac 1 x} = a_{n-1} + \frac{x}{a_n x + 1} = \frac{ (a_{n-1} a_n + 1) x + a_n }{a_{n-1} x + 1}$$ So you have $$a_{n-2} + \cfrac 1 {a_{n-1} + \cfrac{x}{a_n x + 1}} = a_{n-2} + \frac{a_n x + 1}{a_{n-1}(a_n x + 1) + x } = \text{etc.}$$ Keep going until you have $$x = \frac{\text{a first-degree polynomial in } x}{\text{another first-degree polyonomial in } x},$$ then multiply both sides by the denominator to get a quadratic equation.
Here's a concrete example: $$x = 3 + \cfrac 1 {2 + \cfrac 1 {5 + \cfrac 1 {2 + \cfrac 1 {5 + \cdots}}}}$$ with $$2,5$$ repeating.
One can write $$y = 3 + \cfrac 1 x = 3 + \cfrac 1 {2 + \cfrac 1 {5 + \cfrac 1 x}}$$ So $$x = 2 + \cfrac 1 {5 + \cfrac 1 x} = 2 + \frac x {5x+1} = \frac{11x+2}{5x+1}$$ $$x = \frac{11x+2}{5x+1}$$ $$5x^2 + x = 11x+2$$ $$5x^2 - 10 x - 2 = 0.$$ $$x = \frac{10 \pm \sqrt{140}}{10} = \frac{5 \pm \sqrt{35}} 5.$$ Since the value we seek is positive, we have $$x= \frac{5 + \sqrt{35}} 5.$$