# “Harmonacci” recurrence and identities for $\pi$

While playing with something totally irrelevant I stumbled upon the recurrence: $$a_{n+1} = \frac{1}{a_n} + a_{n-1}$$

It turns out that given $a_0 = 1, a_1 = 1$,

$$lim \frac{a_{2n}}{a_{2n-1}} = \frac{\pi}{2}$$

I have a very crude idea (or rather a hint) on proving it (the iterations sort of unfold into a sort of Viete product, which is sort of expected), but my technique is rusty at best.

With different initial conditions, things start getting really scary, for example $a_0 = 2, 3, 4, 5$ yield $\frac{8}{\pi}, \frac{9\pi}{8}, \frac{128}{9\pi}, \frac{225\pi}{128}$ respectively.

So, the questions are: Is it a known fact? If so, where can I read more on it? If not, may anybody help me to prove/disprove it? Does it mean anything?

-
+1 for "Harmonacci" –  Dirk Jan 18 '13 at 8:08
So, in terms of continued fractions, we have $a_{n+1}=[a_{n-1}; a_{n-2},\dots, a_2, a_1, a_0, a_1]$. –  Nikita Sidorov Jan 18 '13 at 8:59
For $a_0=2n+1$, the numerator of the limit $l_{2n+1}$ seems to be $(1\times 3\times...(2n+1))^2\pi$ and its denominator $2^{2n}\times D(l_{2n-1})$, where $D(l_{2n-1})$ is the denominator of $l_{2n-1}$. And it seems that $l_{2n}=2^{2n}/l_{2n-1}$. Maybe a proof by reccurence could be achieved. –  Sylvain JULIEN Jan 18 '13 at 10:05
A cute reformulation: start with a unit square, put another next to it on the left, then a 2 x 1/2 along the top and continue always adding a unit area rectangle alternating top and left. What is the limiting ratio of length to height? –  Aaron Meyerowitz Jan 18 '13 at 13:11
Aaron - Cute indeed. –  Victor P Jan 20 '13 at 6:24

The sequence $a_n$ is closely related to the Wallis product $$a'_n = \prod_{i = 1}^n \left(\frac{2i}{2i - 1} \frac{2i}{2i + 1}\right),$$ which converges to $\pi/2$ as $n$ goes to infinity. Namely, we have $$a'_n = a_{n + 1} \cdot \frac{2n}{2n + 1}$$. This could be proven by induction or maybe more easily by defining $b_n = a_n a_{n - 1}$ and noticing that the recursion for $a_n$ implies the (very simple) recursion $$b_{n + 1} = 1 + b_n$$ for $b_n$ and expressing $a_n$ in terms of the $b_n$.
For more general values of $a_0$ one gets similar formulas for $a_n$ as (up to a factor converging to 1) a Wallis product or inverse of a Wallis product where a few of the lower terms in the product are missing.