Finding recursive formula for repeated term on sequence I have a sequence
$$3,3,3,3,4,4,4,4,4,4,5,5,5,5,5,5,5,5,...$$
The pattern is so difficult. The best i can do is knowing that after jumping to the "next number" it has length $2+2n$. I mean i have $3$ as initial value. And first repeated term has lenght $2+2(1)=4$.  ($4$ repeated term) The second number is $4$ and its length is $2+2(2)=6$. ($6$ repeated term). The third number is $5$ and its length is $2+2(3)=8$. ($8$ repeated term)
How to find the recursive formula? I'm really stuck. Please help me.

$$a_0=3;\;a_n=a_{n-1}+\left\lfloor -\text{frac}\left(\frac{1}{2} \left(\sqrt{4 n+9}-3\right)\right)\right\rfloor +1$$
where $\text{frac}(x)$ is the fractional part of $x$.
From $0$ to $20$ we have
$$\{3,3,3,3,4,4,4,4,4,4,5,5,5,5,5,5,5,5,6,6,6\}$$
This works because $\frac{1}{2} \left(\sqrt{4 n+9}-3\right)$ is integer when $n=k^2+3k$ which give exactly the sequence $4,10,18,\ldots$ when the number of the given sequence must increase by one.
I mean $3,3,3,3,\mathbf{4},4,4,4,4,4,\mathbf{5},5,5,5,\ldots$
