Reverse continued fraction

continued-fractionselementary-number-theory

The problem doesn't seem that difficult but I am unable to come up with a solution :

Let $$\theta=\overline{[a_0,a_1 ……. a_n]}$$ be purely periodic continued fraction. Then find the continued fraction $$\overline{[a_n,a_{n-1}……. a_1]}$$ in terms of theta and it's conjugate.

Best Answer

Note: Some people start their continued fractions with index $1$, we adopt this convention, does not change the content.

Consider the fraction

$$[a_1, a_2, \ldots, a_n, x] = \frac{p x + p'}{q x + q'}$$

where $\frac{p}{q} = [a_1, \ldots, a_n]$, and $\frac{p'}{q'} = [a_1, \ldots, a_{n-1}]$.

We see that including $x$ in a continued fraction with entries $[a_1, \ldots, a_n]$ applies to $x$ a certain Möbius transform. It is given by the matrix $\begin{pmatrix} p & p' \\ q & q'\end{pmatrix}$. But one sees easily that it is in fact the composition of Mobius transforms like this $t \mapsto a + \frac{1}{t}$, which is given by the matrix $\begin{pmatrix} a &1 \\1 & 0 \end{pmatrix}$. Therefore, we have

\begin{eqnarray} \begin{pmatrix} p & p' \\ q & q'\end{pmatrix} = \begin{pmatrix} a_1 & 1 \\ 1 & 0\end{pmatrix}\cdot \begin{pmatrix} a_2 & 1 \\ 1 & 0\end{pmatrix}\cdot \cdots \cdot \begin{pmatrix} a_n & 1 \\ 1 & 0\end{pmatrix} \end{eqnarray}

Now, your number $\theta$ is the positive root of the equation

$$x = \frac{ p x + p'}{q x + q'}$$

How to get the other number?

In the equation above with products of matrices, take the transpose on both sides. Notice that on RHS we have symmetric matrices. Therefore

\begin{eqnarray} \begin{pmatrix} p & q \\ p & q'\end{pmatrix} = \begin{pmatrix} a_n & 1 \\ 1 & 0\end{pmatrix}\cdot \begin{pmatrix} a_{n-1} & 1 \\ 1 & 0\end{pmatrix}\cdot \cdots \cdot \begin{pmatrix} a_1 & 1 \\ 1 & 0\end{pmatrix} \end{eqnarray}

We conclude that $\psi = [\overline{a_n, a_{n-1}, \ldots, a_1}]$ is the positive root of the equation

$$x = \frac{p x + q}{p' x + q'}$$

Therefore

$$\theta = \frac{(p-q') + \sqrt{(p+q')^2 - 4 ( p q' - p' q)}}{2 q}$$

while $$\psi = \frac{(p-q') + \sqrt{(p+q')^2 - 4 ( p q' - p' q)}}{2 p'}$$

We notice that $\psi = \frac{q}{p'} \cdot \theta\ \ $. Also check that $$\theta \cdot \bar {\theta} = - \frac{q'}{p}$$

Therefore we get

$$\psi = - \frac{\theta}{N( \theta)}$$

quite an inversion.

Related Question