# How to transform a continued fraction so that all denominators are positive?

I came across this quote:

"Every continued fractions $$a_1, a_2, ..., a_n$$ can be transformed to a unique canonical form $$\beta_1, \beta_2, ...., \beta_m$$, where all $$\beta$$ 's are positive or all negative integers and $$m$$ is odd."

Page 14 of this document:

enter image description here

What is the system to turn a continued fraction with a negative denominator into an equivalent continued fraction with all denominators positive? Can I get an example?

• It might help to know the context of the quote. May 24 '19 at 17:45
• @GregMartin I included the source. May 24 '19 at 18:41

At least in some cases you can make the following transformation:

$$\frac{\dots}{a + \frac{1}{-b + \frac{1}{\dots} }} = \frac{\dots}{a -1 + \frac{b-1-\frac1\dots}{b - \frac1\dots }} = \frac{\dots}{a -1 + \frac{1}{1+\frac{1}{b-1-\frac1\dots}}}$$

So you have substitued $$\dots,a,b,\dots\quad\quad \text{by}\quad\quad \dots,a-1,1,b-1,-(\dots)$$ But now you have to be careful with the remainder of the continued fraction as it is now negative (you might repeat the same trick). You have also to be careful if $$a=1$$ or if $$b=1$$ or both.

Surely there is a better method!

This question is an example of why including context is so important. Once the OP posted the actual paper, we see that it is a lemma—with a proof included!

The writers of the quote don't actually start with one continued fraction and transform it into another. Rather, they are just saying that every continued fraction (in the class they are considering) evaluates to some rational number, and it is well known that every rational number can be represented by a continued fraction with the given properties. Finding such a representation is most easily done starting from the rational number itself, not from some other continued fraction representation.

Here is an example using the transformation presented on page 23 of the manuscript Rational Tangles and Continued Fractions by Kauffman & Lambropoulou from the continued fraction $$\frac p q$$ to

$$\frac {p'}{ q'}=\left [a_1; a_2,\dots,a_{i-2},(a_{i-1}-1),\color{orange}1,-\frac r l \right]$$

with $$\frac r l =\left[ a_{i+1},a_i +1, \dots, a_n\right ]$$ and $$a_i$$ being the first negative entry.

Example:

The continued fraction

$$[0; 1, \color{blue}3, - 4, 2]=0+\frac{1}{1 +\frac{1}{3+\frac{1}{-4+\frac{1}{2}}}}=\frac{19}{26}$$

can be, therefore, expressed as

$$[0;1,\color{blue}{(3-1)},\color{orange}1,\color{red}3,-2]=\frac{19}{26}$$

since $$\frac r l = \left[(-4+1),2\right].$$

This, in turn can be expressed equivalently as

$$\left [ 0; 1,2,1,\color{red}{(3-1)},\color{orange}1,1 \right ]=\frac{19}{26}$$

with the corresponding new $$\frac r l =\left[ (-2 + 1)\right],$$ and the new $$a_{i-1}=\color{red}3.$$