# Is this formula for $\frac{e^2-3}{e^2+1}$ known? How to prove it?

I found an interesting infinite sequence recently in the form of a 'two storey continued fraction' with natural number entries:

$$\frac{e^2-3}{e^2+1}=\cfrac{2-\cfrac{3-\cfrac{4-\cdots}{4+\cdots}}{3+\cfrac{4-\cdots}{4+\cdots}}}{2+\cfrac{3-\cfrac{4-\cdots}{4+\cdots}}{3+\cfrac{4-\cdots}{4+\cdots}}}$$

The numerical computation was done 'backwards', starting from some $x_n=1$ we compute:

$$x_{n-1}=\frac{a_n-x_n}{a_n+x_n}$$

And so on, until we get to $x_0$. The sequence converges for $n \to \infty$ if $a_n>1$ (or so it seems).

For constant $a_n$ we seem to have quadratic irrationals, for example:

$$\frac{\sqrt{17}-3}{2}=\cfrac{2-\cfrac{2-\cfrac{2-\cdots}{2+\cdots}}{2+\cfrac{2-\cdots}{2+\cdots}}}{2+\cfrac{2-\cfrac{2-\cdots}{2+\cdots}}{2+\cfrac{2-\cdots}{2+\cdots}}}$$

For $a_n=2^n$ we seems to have:

$$\frac{1}{2}=\cfrac{2-\cfrac{4-\cfrac{8-\cdots}{8+\cdots}}{4+\cfrac{8-\cdots}{8+\cdots}}}{2+\cfrac{4-\cfrac{8-\cdots}{8+\cdots}}{4+\cfrac{8-\cdots}{8+\cdots}}}$$

I found no other closed forms so far, and I don't know how to prove the formulas above. How can we prove them? What is known about such continued fractions?

There is another curious thing. If we try to expand some number in this kind of fraction, we can do it the following way:

$$x_0=x$$

$$a_0=\left[\frac{1}{x_0} \right]$$

$$x_1=\frac{1-a_0x_0}{1+a_0x_0}$$

$$a_1=\left[\frac{1}{x_1} \right]$$

However, this kind of expansion will not give us the above sequences. We will get faster growing entries. Moreover, the fraction will be finite for any rational number. For example, in the list notation:

$$\frac{3}{29}=[9,28]$$

You can easily check this expansion for any rational number.

As for the constant above we get:

$$\frac{e^2-3}{e^2+1}=[1,3,31,74,315,750,14286,\dots]$$

Not the same as $[1,2,3,4,5,6,7,\dots]$ above!

We have similar sequences growing exponentially for any irrational number I checked.

$$e-2=[1,6,121,284,1260,3404,25678,\dots]$$

$$\pi-3=[7,224,471,2195,10493,46032,119223,\dots]$$

By the way, if we try CF convergents, we get almost the same expansion, but finite:

$$\frac{355}{113}-3=[7,225]$$

$$\frac{4272943}{1360120}-3=[7,224,471,2195,18596,227459,\dots]$$

So, the convergents of this sequence are not the same as for the simple continued fraction, but similar.

Comparing the expansion by the method above and the closed forms at the top of the post, we can see that, unlike for simple continued fractions, this expansion is not unique. Can we explain why?

Here is the Mathematica code to compute the limit of the first fraction:

Nm = 50;
Cf = Table[j, {j, 1, Nm}];
b0 = (Cf[[Nm]] - 1)/(Cf[[Nm]] + 1);
Do[b1 = N[(Cf[[Nm - j]] - b0)/(Cf[[Nm - j]] + b0), 7500];
b0 = b1, {j, 1, Nm - 2}]
N[b0/Cf[[1]], 50]

And here is the code to obtain the expansion in the usual way:

x = (E^2 - 3)/(E^2 + 1);
x0 = x;
Nm = 27;
Cf = Table[1, {j, 1, Nm}];
Do[If[x0 != 0, a = Floor[1/x0];
x1 = N[(1 - x0 a)/(x0 a + 1), 19500];
Print[j, " ", a, " ", N[x1, 16]];
Cf[[j]] = a;
x0 = x1], {j, 1, Nm}]
b0 = (1 - 1/Cf[[Nm]])/(1 + 1/Cf[[Nm]]);
Do[b1 = N[(1 - b0/Cf[[Nm - j]])/(1 + b0/Cf[[Nm - j]]), 7500];
b0 = b1, {j, 1, Nm - 2}]
N[x - b0/Cf[[1]], 20]

Update

I have derived the forward recurrence relations for numerator and denominator:

$$p_{n+1}=(a_n-1)p_n+2a_{n-1}p_{n-1}$$ $$q_{n+1}=(a_n-1)q_n+2a_{n-1}q_{n-1}$$

They have the same form as for generalized continued fractions (a special case). Now I understand why the expansions are not unique.

• I am always thoroughly impressed with the length and detail in your posts. On the other hand, you might want to key in a little more on what your main question is here. – Brevan Ellefsen Feb 7 '17 at 22:25
• @BrevanEllefsen, if these are known results, I would like a reference. If not, I would like a hint about a proof. And the most important question - why is the expansion not unique, even though the properties seem to be similar to simple continued fractions. Thanks, by the way. I'm glad I'm not the only one who likes my posts :) – Yuriy S Feb 7 '17 at 22:26
• @Nemo, I'm not sure I understand what you did here, but I figured out the same thing after deriving the forward recurrence relations for numerator and denominator: $$p_{n+1}=(a_n-1)p_n+2a_{n-1}p_{n-1}$$ $$q_{n+1}=(a_n-1)q_n+2a_{n-1}q_{n-1}$$ Obviously, we have a special case of a generalized continued fraction. Which is why it is not unique – Yuriy S Feb 8 '17 at 9:18

For the first one, you could write $$f(n) = \frac{n-f(n+1)}{n+f(n+1)}$$ Then you suggest $$f(2) = \frac{e^2-3}{e^2+1}$$ But this then gives \begin{align} f(1) = \frac{2}{e^2-1}\\ f(3) = \frac{4}{e^2-1} \\ f(4) = \frac{3e^2-15}{e^2+3}\\ f(5) = \frac{-2e^2+18}{e^2-3} \end{align} I don't know if there is a recurrence relation that solves this, but you have a few more closed forms...
The second one we have $$g(2) = \frac{2 - g(2)}{2+g(2)}$$ so we can solve the quadratic $x^2+3x-2$ to get $(\sqrt{17}-3)/2$.
For the third one, we have $$h(n) = \frac{n-h(2n)}{n+h(2n)}$$ using the trial version of $h(2)=1/2$, we get \begin{align} h(4)=\frac{2}{3}\\ h(8)=\frac{4}{5}\\ h(16)=\frac{8}{9} \end{align} then it is likely that $$h(n)=\frac{n}{n+2}$$ as this satisfies the recurrence and that $h(2)=1/2$.
• Thank you, when I look back it's clear that quadratic radicals or rational numbers are easily proven (provided the limit exists), just as you show here. For irrational numbers see the comments and the update, linking this to generalized continued fractions, and the proofs for $e$ related numbers can be found elsewhere – Yuriy S May 31 '17 at 11:29