Suppose $a,b$ are two natural numbers relatively prime to $n$ and to each other. Assume $n\geq ab+1$. Suppose further that $\frac{a}{b}\equiv k \pmod{n}$ for some $k\in \lbrace 1,2,\dots, n-1\rbrace$ and $\frac{a}{b}\equiv k'\pmod{n+ab}$ for some $k'\in \lbrace 1,2,\dots, n+ab-1\rbrace$.

Question: Is there an elementary proof that the length of the continued fraction of $\frac{n}{k}$ is equal to the length of the continued fraction of $\frac{n+ab}{k'}$?

This came out of a broader result, and for this particular case I can prove it using routine toric geometry, however I would like to know of some elementary tricks to deal with continued fractions.

Here by continued fraction I mean the Hirzebruch continued fraction
$$\frac{n}{k}=a_0-\frac{1}{a_1-\frac{1}{a_2-\cdots}}.$$
For example, when $a=2, b=3$ and $n=17$, we get $k=12$ and $k'=16$, so the fractions are
$$\frac{17}{12}=2-\frac{1}{2-\frac{1}{4-\frac{1}{2}}}\qquad and \qquad\frac{23}{16}=2-\frac{1}{2-\frac{1}{5-\frac{1}{2}}}.$$

Sometimes known as the "negative-regular continued fraction".
–
Gerry MyersonNov 3 '12 at 4:28

Is there, by any chance, a pun on Kettenbruch?
–
Alain ValetteNov 3 '12 at 7:16

4

@Alain Valette: I am not sure if you mean something more specific, but the Hirzebruch is the mathematician, as he conisdererd them somewhere, sometimes also the name Jung is mentioned in addition. So one finds say Hirzebruch-Jung-Kettenbruch in German texts. I could envision somebody coming along and calling it (or rather the plural) Hirzebrüche as a pun; I found nothing googling for this. But, the next person doing so might ;)
–
quidNov 3 '12 at 11:09

2

@Gjergji: Your "routine toric geometry" line brought a smile to my face. I suppose you could try to convert the routine geometry facts into statements on the geometry of numbers. As far as I can remember the length of the Hirzebruch-Jung continued fraction is related to the number of edges in a Newton polygon, the convex hall of the nonzero lattice points in side the angle determined by the positive horizontal semi-axis and the ray of slope $a/b$.
–
Liviu NicolaescuNov 5 '12 at 10:18

1

According to Perron (Vol. 1, $\S$ 43) this fraction as known as ``reduced regular continued fraction'' (reduziert-regelmaessige Kettenbrueche).
–
Alexey UstinovNov 6 '12 at 1:35

Theorem.If $(n,ab)=1$ and $n>ab$ then RRCF for all numbers
$$\left\{\frac{ab^{-1}\pmod{(n+kab)}}{n+kab}\right\}\qquad(k\ge
0)$$ are almost equal: they have equal length and differ only in
one partial quotient.

Remark 1. Common factors of $a$ and $b$ can be moved into $k$.
If $d=(a,b)$, $a=da_1$, $b=db_1$, then \begin{gather*} \left\{
\frac{ab^{-1}\pmod{(n+kab)}}{n+kab}\right\} =\left\{
\frac{a_1b_1^{-1}\pmod{(n+kab)}}{n+kab}\right\} \\=\left\{
\frac{a_1b_1^{-1}\pmod{(n+(kd^2)a_1b_1)}}{n+(kd^2)a_1b_1}\right\}.
\end{gather*}
So we can assume that $(a,b)=1$.

Remark 2. The proof will be given in terms of modified
continuants $K(x_1,\ldots, x_n)$ (see ``Concrete Mathematics'' for
more explanations). These polynomials are defined by initial
conditions
$$K()=1,\quad K(x_1)=x_1$$
and the following recurrence:
$$K(x_1,\ldots,
x_n)=x_nK(x_1,\ldots, x_{n-1})-K(x_1,\ldots,
x_{n-2})\qquad(n\ge2).$$ (In the usual definition minus must be
replaced by plus.) For convenience $K_{-1}:=0$ (empty RRCF is
$0$).

In terms of continuants RRCF can be written as
$$\langle x_1,\ldots,x_n\rangle=\frac{K(x_2,\ldots,
x_n)}{K(x_1,\ldots, x_n)}.$$

Continuant's properties. All these properties can be proved by
induction (or from ``Euler’s rule'').

Forgive me, this should be in the comments, but I am still building my reputation up to comment. If a=5, b=4, n=7, then k=3, k'=8, and n+ab=27.

Here, $\frac{n}{k}=\frac{7}{3}=3-\frac{1}{2-\frac{1}{2}}$ but $\frac{n+ab}{k'}=\frac{27}{8}=4-\frac{1}{2-\frac{1}{3-\frac{1}{2}}}$. Am I missing something or is there a further assumption on these numbers?