# Continued fractions of rational vs irrational numbers

I was wondering, if it were possible if you were given a continued fraction expansion for a number, to be able to determine if the number was rational or irrational? I know that if it is never repeating the number is irrational but not quadratic, but if it is periodic can you tell whether it’s rational?

• If the continued fraction terminates at a point its rational ,otherwise it is irrational – The Integrator Mar 26 '18 at 12:37
• A rational number has a finite continued fraction. An irrational does not. – B. Goddard Mar 26 '18 at 12:37

If the expansion terminates, then it is really just a fraction, and all we have to do is simplify it. Conversely, suppose the number $x$ is rational. Then, when we write $x=a_0+\frac{1}{x_1}$, we obtain a rational number $x_1$ with a smaller denominator than $x$. The denominator is a positive integer, and these can't keep getting smaller forever. Eventually, the denominator reaches $1$, and we're done.