Closed Form Formula for Nonlinear Recurrence $a_{n+1}=\frac{a_{n}}{2} + \frac{5}{a_{n}}$ I'm trying to find a closed form solution to the sequence
$a_{n+1}=\frac{a_{n}}{2} + \frac{5}{a_{n}}$
I tried using a generating function approach in the following way:
Let $$f(x) = \sum_{n=1}^\infty a_n x^n$$
Then multiplying the original equation with $x^n$ and summing over all $n$, we get:
$$\sum_{n=1}^\infty a_{n+1}x^n= \sum_{n=1}^\infty \frac{a_{n}}{2} x^n + \sum_{n=1}^\infty\frac{5}{a_{n}} x^n$$
$$= \frac{f(x) - a_1}{x} = \frac{f(x)}{2} + 5 \sum_{n=1}^\infty \frac{x^n}{a_n}$$
But now I don't know how to simplify the last term and I get stuck. I put it on Wolframalpha and
found the general solution to the recurrence relation as:
$$a_n = -i \sqrt{10} \cot\left(c_1 2^n\right)$$

Based on the Wolfram Alpha answer, this is how one would get a closed form for $a_n$:
First, the substitution $a_n = b_n\sqrt{10}$ yield the equation
$$b_{n+1}=\frac{b_n+b_n^{-1}}{2}$$
Now take $b_n = \coth c_n$ to get
$$\coth c_{n+1} = \frac{\coth c_n + \tanh c_n}{2} = \coth (2c_n)$$
From this, $c_{n+1} = 2 c_n$. This means that $c_n = k\, 2^n$ for some $k$.
So $a_n = \sqrt{10} \coth(k\, 2^n)$.
It's not hard to check that this satisfies the recurrence relation.
