I have a recurrence: $x_n = x_{n-1} + \frac{1}{X_{n-1}}$. I need the value of n for which $x_n$ IS CLOSEST TO $2*x_0$, where $x_0$ is a positive integer.
I tried the following:
$x_1 = x_0 + \frac{1}{x_0}$
$x_2 = x_1 + \frac{1}{x_1}$
..
$x_n = x_{n-1} + \frac{1}{x_{n-1}}$
Adding, $x_n = x_0 + \sum_{i=1}^n\frac{1}{x_i}$
or, $2x_0 = x_0 + \sum_{i=1}^n\frac{1}{x_i}$
or, $x_0 = \sum_{i=1}^n\frac{1}{x_i}$
I might be horribly wrong in my approach, because I lack the required skills.
Hint: Square the equation, you get
$$x_i ^2 = x_{i-1}^2 + 2 + \frac{1}{x_{i-1} ^2 } $$
Suppose we want the smallest $n$ such that $x_n \geq 2 x_0 $. Since $ x_i ^2 \geq x_{i-1} ^2 + 2$, this tells us that $ n \leq \frac{ 3x_0^2}{2}$.
Now, you need to find a lower bound, to show that $n = \lfloor \frac{ 3x_0^2}{2} \rfloor$ is indeed the answer that we want.
You can read solutions to this question if you need further help.