Does this deceptively simple nonlinear recurrence relation have a closed form solution? Given the base case $a_0 = 1$, does $a_n = a_{n-1} + \frac{1}{\left\lfloor{a_{n-1}}\right \rfloor}$ have a closed form solution? The sequence itself is divergent and simply goes {$1, 2, 2+\frac{1}{2}, 3, 3+\frac{1}{3}, 3+\frac{2}{3}, 4, 4+\frac{1}{4}, 4+\frac{2}{4}, 4+\frac{3}{4}, . . .$} and so forth. It seems like it should be easy but I can't seem to find a solution. Any suggestions?
 A: The sequence $a_n$ for $n\geq 1$ has the following formula:
$$a_n=\left\lfloor \sqrt{2n}+\tfrac{1}{2}\right\rfloor +\frac{\left\lfloor \frac{1}{2} \left(\sqrt{8 n-7}+1\right)\right\rfloor-\left\lfloor \frac{1}{2} \left(\sqrt{8 n-7}+1\right)\right\rfloor ^2 +2 n}{2 \left\lfloor \sqrt{2n}+\frac{1}{2}\right\rfloor }.$$
Here is the Wolfram Alpha link to check it.
It is related to OEIS A002024 and OEIS A002262.
A: A similar, possibly simpler closed form is the following: set $$b_n=\left\lfloor\frac{1+\sqrt{8n-7}}{2}\right\rfloor,$$
then $$a_n=\frac{b_n+1}{2}+\frac{n-1}{b_n}.$$
It is not hard to derive this from the observation that whenever $n-1$ is a triangular number $k(k-1)/2$, one has $a_n=k$.
A: I have decided to call this sequence $\Theta_n$ for the triangular-harmonic number sequence because it clearly has properties related to both triangular and harmonic numbers.
I had been studying it by using the recursive definition $$\Theta_0 = 1\mid\Theta_n = \Theta_{n-1} + \frac{1}{\lfloor\Theta_{n-1}\rfloor}$$
The simplest closed form of the sequence is
$$\Theta_n = \frac{T_n^{-1}}{2} + \frac{n}{T_n^{-1}} + \frac{1}{2} \mid n\geq1$$ with $$T_n^{-1}=\lfloor\sqrt{2n}+\frac{1}{2}\rfloor$$ being the inverse triangular number function. I have been researching its many fascinating properties.
