Given the base case $a_0 = 1$, does $a_n = a_{n1} + \frac{1}{\left\lfloor{a_{n1}}\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?

$\begingroup$ I will point out that the tag (discretemathematics) is deprecated on MathOverflow, see the taginfo. Moreover, the question is also missing toplevel tag. Since I am not really sure about a suitable choice of tags for this question, I'll leave retagging to more experienced users. $\endgroup$– Martin SleziakFeb 22 '19 at 18:23
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 n7}+1\right)\right\rfloor\left\lfloor \frac{1}{2} \left(\sqrt{8 n7}+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.

1$\begingroup$ Great! Thanks, Carlo. Looking at that, I would have never have found that on my own. :) $\endgroup$ Feb 20 '19 at 20:14
A similar, possibly simpler closed form is the following: set $$b_n=\left\lfloor\frac{1+\sqrt{8n7}}{2}\right\rfloor,$$ then $$a_n=\frac{b_n+1}{2}+\frac{n1}{b_n}.$$ It is not hard to derive this from the observation that whenever $n1$ is a triangular number $k(k1)/2$, one has $a_n=k$.

$\begingroup$ it does not quite seem to work: I find from your formula $1,2,2,\frac{5}{2},3,3,\frac{10}{3},\frac{11}{3},4,4,\frac{17}{4},\frac{9}{2},\frac{19}{4},5,5,...$, so there is this repetition of the integers which should not be there...  here is the Wolfram Alpha link  did I make a mistake? $\endgroup$ Feb 22 '19 at 20:34

$\begingroup$ No, I did... Thanks! I had done everything in my mind and forgot to check $\endgroup$ Feb 23 '19 at 9:00

1$\begingroup$ yes, the corrected formula now works as intended: Wolfram alpha $\endgroup$ Feb 23 '19 at 14:11

2$\begingroup$ Actually the other night, I found Ale's simpler form as well only with $b_n = \left \lfloor{\sqrt{2n}+\frac{1}{2}}\right \rfloor$ instead. Apparently $\left \lfloor{\frac{1+\sqrt{8n7}}{2}}\right \rfloor = \left \lfloor{\sqrt{2n}+\frac{1}{2}}\right \rfloor$. $\endgroup$ Feb 23 '19 at 17:20
I have decided to call this sequence $\Theta_n$ for the triangularharmonic 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_{n1} + \frac{1}{\lfloor\Theta_{n1}\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.