Finding the nth element of a sequence Suppose we have sequence given by
$$ (1,2,2,3,3,3,4,4,4,4,5,5,5,5,5,...) $$
I need to prove that $a_n = \lfloor{ \sqrt{2n} + \frac{1}{2} \rfloor} $.
Try:
I notice the following. The last occurrence of 1 occurs at $a_1$, the last occurrence of $2$ occurs at $a_3$, the last occurrence of $3$ occurs at $a_6$. So, if we define $F(n)$ to be the last occurrence of digit $n$, then we guess
$$ P(n) = \frac{n(n+1)}{2} $$
Who show by induction. base case is clear. Suppose the formula holds true for some $k$, that is suppose $P(k) = \frac{ k(k+1) }{2}$.
Note $P(k+1) = P(k) + k+1$
since the (k+1)th last entry is k+1 positions after the kth entry. Thus,
$$ P(k+1) = \frac{k(k+1)}{2} + k+1 = \frac{(k+1)(k+2)}{2} $$
and guess is true by induction.
Now, let $a_n = m$. Since $a_n$ must lie between $P(m-1)$ and $P(m)$ we have
$$ P(m-1) < n \leq P(m) \implies \frac{ (m-1)m}{2} < n \leq \frac{m(m+1)}{2} \implies m^2 - m < 2n \leq m^2 + m $$
now, since $m^2 + m + 1/4 > m^2 + m$ and since adding $1/4$ to $m^2-m$ would still be less than $2n$, then
$$ m^2 - m + \frac{1}{4} < 2n < m^2 +m + \frac{1}{4} \iff (m-1/2)^2 <2n < (m+1/2)^2 $$
Thus,
$$ m - 1/2 < \sqrt{2n} < m + 1/2 \implies m < \sqrt{2n} < m + 1$$
Hence, $m = a_n = \lfloor{ \sqrt{2n} + \frac{1}{2} \rfloor}$.
Is this a correct argument? Any feedback would be really appreciated. IS there a better approach to solve this problem?

In your sequence the first occurrence of $m\in\{1,2,\ldots\}$ appears at the position $1+2+\ldots+(m-1)+1 = \frac{m^2-m}{2}+1$ and the last one at the position $1+2+\ldots+m=\frac{m^2+m}{2}$. To prove the claim it is enough to show that the function $f:x\mapsto\left\lfloor\sqrt{2x}+\frac{1}{2}\right\rfloor$ maps every element of the interval $\left[\frac{m^2-m}{2}+1,\frac{m^2+m}{2}\right]$ into $m$. 
Since $f$ is a weakly increasing function, it is enough to show that both the endpoints of the previous interval are mapped into $m$. We have
$$\left(m-\frac{1}{2}\right)^2 = m^2-m+\frac{1}{4} < m^2-m+2 < m^2+m+2 \leq  (m+1)^2 $$
and the claim easily follows.
