# quasi periodic continued fractions and powers of e, tanh, tan

It is well known that some transcendental numbers like e.g. rational multiples of $e^{2/n}$ with $n\in\mathbb N$, when written as regular continued fractions (R.C.F.), yield what can be called a quasi periodic form, meaning that the terms, after possibly an aperiodic onset, are 'periodic' but with some of them undergoing linear shifts, e.g.

$e^{1/n} = [1 ; 3n-1,1,1,5n-1,1,1,7n-1,1,1,...]=:[1 ; \overline{(2\lambda +1)n-1,1,1}]$, where $\lambda$ is meant to run through $1,2,3,...$. Sometimes the periodic part is also written as $K_{\lambda=1}^\infty[(2\lambda +1)n-1,1,1]$. So this R.C.F. has period 3, and one of the three periodic terms is shifted by $2n$ each time.

If we take the most general form $x=\dfrac{ae^{2/n}+b}{ce^{2/n}+d}\$ with $a,b,c,d\in\mathbb Z$ and $ad\ne bc$, it appears that the (periodic part of the) R.C.F. of $x$ is built of quite simple patterns. Let me first give two "typical" examples:

For $x=\dfrac{3e-3}{e+1}$, the R.C.F. has period 10 and is given by

[1; 2   1  1  2   3   42   6   66   8
1  2   9  1  2  11  114  14  138  16
1  2  17  1  2  19  186  22  210  24
1  2  25  1  2  27  258  30  282  32  ...]

For $x=\dfrac{2e^{2/3}-3}{4e^{2/3}-3}$, the R.C.F. has period 20 and is given by

[0; 5  2  1  5  1 11  2  5  8  1  5  2  1  1  2  2  2  1  5
14  1  5  4 11  1  3  1  5 20  1  5  5  1  1  2  2  5  1  5
26  1  5  7 11  1  6  1  5 32  1  5  8  1  1  2  2  8  1  5
38  1  5 10 11  1  9  1  5 44  1  5 11  1  1  2  2 11  1  5
50  1  5 13 11  1 12  1  5 56  1  5 14  1  1  2  2 14  1  5 ...]

Now here are some conjectures, based on examining a fair amount of numbers of the above form:

• The constant entries (i.e. the "really" periodic ones) come in blocks of even lengths.

This should follow by Gosper's algorithm for computing the R.C.F. for $\frac{ax+b}{cx+d}$ from the R.C.F. for $x$ from the fact that it holds for all $x=e^{2/n}$. But I wonder if there is a more direct way to prove it.

• All ratios between shifts of the non constant entries are rational squares,

e.g. the shifts are 8 and 72=9*8 in the first example above, and 3 and 12=4*3 in the second one. (There can also be more than two different shifts.)

The minimal period lengths are quite irregular, but it looks like the following holds:

• For a reduced fraction $\frac pq$ , the R.C.F. of $\frac pq e$ has an even period iff $p+q$ is odd, and its "height" (=the biggest of the periodic entries) is $2pq-1$.

(Note that replacing $e$ by $e^{2/n}$ here, this still seems to hold often but not always. Interesting...)

Finally, I have two questions that dig somewhat deeper:

It seems like for $r\in\mathbb Q$, the R.C.F of $e^r$ is quasi-periodic iff $2/r\in\mathbb Z$. Can this be linked with Fermat's theorem as stated in the following way?
For $r\in\mathbb Q$, the equation $x^r+y^r+z^r=0$ has non trivial rational solutions iff $2/r\in\mathbb Z$.

And, digging in a different direction:

$e^x$ is a rational function of $\tanh(x/2)$. Now, if we replace $\tanh(x/2)$ by $\tan(x/2)=-i\tanh(ix/2)$, equivalently if we look at the R.C.F. forms of $x=\dfrac{a\tan(1/n)+b}{c\tan(1/n)+d}\$ with $n\in\mathbb N$, the striking thing is that the situation "at the surface" (where nothing complex is visible) seems very similar to the one mentioned above, with the notable difference that all block lengths of periodic entries appear to be odd here!
What is happening "in the depth"?

• This material appear related to a paper of Hurwitz: Ueber die Kettenbrüche, deren Teilnenner arithmetische Reihen bilden. (German) Zürich. Naturf. Ges. 41, 2. Teil. 34-64. Published: (1896). Also Lambert proved that $$\frac{e^u-1}{e^u+1}=[0,2/u,6/u,10/u,...]$$ this explain some of your numbers $2/r \in\bf Z$. – juan Jan 5 '13 at 19:29
• Yes, Hurwitz shows for example that the shifts of $(ad-bc)\dfrac{ax+b}{cx+d}\$ are essentially the same as those of $x$. But that is only part of the story. – Wolfgang Jan 5 '13 at 21:19
• You may be interested in a paper of Gábor Hetyei, Hurwitzian continued fractions containing a repeated constant and an arithmetic progression, arxiv.org/abs/1211.2494 – Gerry Myerson Jan 16 '13 at 21:57