<s>[INST] Limit of recursive sequence defined by $a_0=0$, $a_{n+1}=\frac12\left(a_n+\sqrt{a_n^2+\frac{1}{4^n}}\right)$ Given the following sequence: $a_0=0$, $$a_{n+1}=\frac12\left(a_n+\sqrt{a_n^2+\frac{1}{4^n}}\right),\ \forall n\ge 0.$$ 
Find $\lim\limits_{n\to\infty}a_n$.
 [/INST] By the given recurrence, $a_{n+1}$ is a root of $x^2-a_n x-\frac{1}{4^{n+1}}$, hence:
$$ \sum_{n\geq 0} a_{n+1}(a_{n+1}-a_n) = \sum_{n\geq 0}\frac{1}{4^{n+1}} = \frac{1}{3}. \tag{1}$$
By assuming $\lim_{n\to +\infty}a_n = L$ and applying summation by parts, we get:
$$ \frac{1}{3} = L^2 - \sum_{n\geq 0}(a_{n+2}-a_{n+1})a_{n+1} \tag{2}$$
but:
$$ \sum_{n\geq 0}(a_{n+2}-a_{n+1})a_{n+1} = -\frac{1}{4}+\sum_{n\geq 0} a_{n}(a_{n+1}-a_n)= \frac{1}{12}-\sum_{n\geq 0}(a_{n+1}-a_n)^2\tag{3} $$
implies
$$ L^2 = \frac{5}{12}-\sum_{n\geq 0}(a_{n+1}-a_n)^2 \tag{4}$$
so $L\leq\sqrt{\frac{5}{12}}$ but $L^2\geq \frac{5}{12}-\sum_{n\geq 0}\frac{1}{16^{n+1}a_n^2}$. Numerically,
$$ L \approx 0.63661977236758\ldots \tag{5}$$
On the other hand, by setting $a_n = \frac{b_n}{2^n}$ we get $b_{n+1}=b_n+\sqrt{b_n^2+1}$, that is associated with the halving formula for the cotangent function. That leads to:
$$ a_n = \frac{1}{2^n}\cot\left(\frac{\pi}{2^{n+1}}\right),\qquad L=\lim_{n\to +\infty}a_n = \color{blue}{\frac{2}{\pi}}. \tag{6} $$
It is very interesting to notice that by combining $(6)$ and $(4)$ we get a fast-converging algorithm for the numerical computation of $\frac{1}{\pi^2}$.
</s>