# Mirror algorithm for computing π\pi and ee – does it hint on some connection between them?

Benoit Cloitre offered two ‘mirror sequences’, which allow to compute $\pi$ and $e$ in similar ways:

The formulation and the proof can be seen here.

What do you think – is it just a coincidence or is there some deeper meaning in this mirror algorithm about the connection of two constants?

By @EricStucky in the comment, the better question:

Is there any connection between $e$ and $π$ which is essentially different than Euler’s formula?

If, on the other hand, someone shows a clear relation between this sequence and Euler’s formula, that’s fine too

Both the limits can be evaluated in a more general scenario where you put constants $a$ and $b$ in front of the two terms on the right-hand side. The recurrence equations can be solved analytically and the corresponding limits taken in the case $a=1 \wedge b=1$. They both involve the gamma function and some powers. The difference between the two “algorithms” is then that in the first, the gamma function is trivial while the power $e^1$ remains, while in the second, the power term calcels out with the factor $2$ but the gamma function brings in $\pi$ (as it often does). So the answer is no, these two sequences don’t disclose any commonalities between the two constants. They just evaluate to expressions which somehow contain both, and in either, one of the terms becomes trivial, leaving only the other.

## Details

Let’s solve the two systems in parallel (NB. the equations below come in pairs to show the correspondence, they are not systems.) Using the method of generating functions, we convert the equations

with initial conditions $u_1 = v_1 = 0$, $u_2 = v_2 = 1$, to ordinary differential equations

where

The solutions for $a>0, b>0$ with a unit quadratic term (the initial condition) are

We can extract the coefficients by writing down and expanding the Taylor series:

The two expansions have some similarities and both allow us to write down and simplify (converting the Pochhammer symbols with negative $k$ to positive $k$ followed by using a straightforward application of the definitions, all doable in hand) the $(n+2)$-th coefficient:

where $p$ and $q$ are shorthand notation for the recurring subexpressions in either formula,

Now the similarity is quite striking (keeping in mind, however, that there’s a world of difference between $_1F_1$ and $_2F_1$, and between evaluation something in $-1$ and in a generic point), but that’s still not too surprising given how simple the original recurrent equations were.

We can find asymptotic forms of $u_n$ and $v_n$ from here. For that, it’s advantageous to rewrite the hypergeometrics so that the dependence on $n$ appears only in the denominator terms. Here are two handy identities just for us: for the $_1F_1$ and for the $_2F_1$. This brings $u_{n+2}$ and $v_{n+2}$ to their equivalent forms

Now as $n \to +\infty$, we are guaranteed that the $_pF_q$ terms approach $1$, so we can just trim them to the zeroth term each. For the generalized binomial coefficients, we use Stirling’s formula for the “big” factorials, leaving

This gives us the asymptotics

As mentioned in the introduction, each of these terms has a geometric term and a gamma function (the factorial). They also have one exponential term each, which goes away for $a=1$ and for $b=1$, respectively:

For $a=1$, $p=b$ and the asymptotic behaviour of $u_{n+2}$ is

and when compensated in a limit procedure, this tends to

In particular, $b=1$ gives the limit $e^1 1! = e$. For half-integer values of $b$, both $e$ (in some power) and $\pi$ (in a square root) will be present simultaneously.

For $b=1$, $q=a/2$ and the asymptotic behaviour of $v_{n+2}$ is

and when squared and compared to $n^a$, this gives the limit

In particular, $a=1$ produces $\Gamma(3/2)^2 / 2^{-1}$. Since $\Gamma(3/2) = (1/2)! = \sqrt\pi/2$, this is one half of $\pi$. The residual power of $2$ is cancelled when the limit expression is ${\bf 2}n / v_n^2$. For a generic odd $a$, there would be some multiple of $\pi$ and some power of $2$.

## Conclusion

Albeit the two equations can be solved using quite similar methods and even their full solutions share a lot of common features, the results $e$ and $\pi$ come ultimately from different and unrelated parts of the formulas. The former comes from a power term when all the other terms become trivial. The latter comes from a special value of a gamma function when the other terms are reduced to a constant of $2$. The base $e$ is connected to the properties of the Kummer function $_1F_1$ whereas the base $2$ appears in a similar function for the Gauss function $_2F_1$.