Is there a closed form for this sequence $a_n = m, \ \binom{m}{2}\le n < \binom{m+1}{2}$? I was playing around with the sequence:
$$
2,2, 3,3,3,4,4,4,4,\dots
$$
If I denote the first element of said sequence by $a_1$ I realized the sequence can be written as
$$
a_n = m, \quad  \binom{m}{2}\le n < \binom{m+1}{2}
$$
for $m \ge 2$. Although the above does work, I would like to find a closed for of a sequence that gives $a_n$ in terms of common functions like the floor function. Does anyone know how I could do this?
I managed to re-arrange the condition $ \binom{m}{2}\le n < \binom{m+1}{2}$ into
$$
0\le \frac{n}{m} + \frac{1-m}{2} < 1 
$$
with hopes of using something like the floor function on it, but I couldn't seem to make it work.
 A: We have
$$
\begin{array}{l}
 \left( \begin{array}{c}
 m \\  2 \\  \end{array} \right) =
 \frac{{m\left( {m - 1} \right)}}{2} \le n < \left( \begin{array}{c}
 m + 1 \\  2 \\  \end{array} \right) = \frac{{m\left( {m + 1} \right)}}{2}\quad  \Rightarrow  \\ 
  \Rightarrow \quad m^2  - m - 2n \le 0 < m^2  + m - 2n\quad  \Rightarrow  \\ 
  \Rightarrow \quad \frac{{\sqrt {1 + 8n}  - 1}}{2} = \frac{{\sqrt {1 + 8n}  + 1}}{2} - 1 <
 m \le \frac{{\sqrt {1 + 8n}  + 1}}{2} \\ 
 \end{array}
$$
and since
$$
x - 1 < \left\lfloor x \right\rfloor  \le x
$$
then
$$
a_n  = \left\lfloor {\frac{{\sqrt {1 + 8n}  + 1}}{2}} \right\rfloor 
$$
where $a_0=1, a_1=2, a_2=2, \cdots$
A: The sequence is listed on the OEIS https://oeis.org/A002024, and lists the function
$$ \operatorname{floor}\left(\frac{\left(1+\sqrt{1+8x}\right)}{2}\right).$$
It is the inverse of the triangular numbers, which is simply the sum of numbers $1$ to $n$. The sequence $2, 2, 3, 3, 3,...$ follows after observing this fact.  (It is simply the floor of the inverse.)

