rational continued fractions

148 Views Asked by At

I've heard of continued fractions, like

$$a=\cfrac{b}{c+\cfrac{d}{e+\cfrac{f}{g+...}}}$$

usually written like:

$$a+\frac{b}{c+}\frac{d}{e+}\frac{f}{g+...}$$

(in my opinion, it's pure genius!) I've heard of some simple ones like:

$$\sqrt 2=\frac{1}{1+}\frac{1}{1+}\frac{1}{1+}\frac{1}{1+}\frac{1}{1+}\frac{1}{1+}\frac{1}{1+...}$$

my question is, is there any way to make rational numbers like $\frac{x}{y}$ into continued fractions that terminate?

1

There are 1 best solutions below

0
On BEST ANSWER

Yes, all rational numbers have terminating continued fractions even when you require that all the numerators be $1$. Wikipedia shows how to compute it and that there are exactly two representations. It should be clear that any finite continued fraction is rational-just unpack it and use the closure of the rationals under addition and multiplication.