<s>[INST] Let $a_n$ be the $nth$ term of the sequence $1, 2, 2, 3, 3, 3, 4, 4, 4, 4, \dots$ Question:Let $a_n$ be the $nth$ term of the sequence $1, 2, 2, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6\dots$, constructed by including the integer $k$ exactly $k$ times. Show that $a_n = \lfloor \sqrt{2n} + \dfrac{1}{2}\rfloor$.
Attempt:
Try to prove $k = a_n=\lfloor \sqrt{2n} + \dfrac{1}{2}\rfloor$ then $k = a_{n+k-1}=\lfloor \sqrt{2(n+k-1)} + \dfrac{1}{2}\rfloor$.
The inequality of $k = a_n=\lfloor \sqrt{2n} + \dfrac{1}{2}\rfloor$, is the following,
$$k \leq \sqrt{2n} + \dfrac{1}{2} < k + 1$$
$$k-\dfrac{1}{2} \leq \sqrt{2n} < k + \dfrac{1}{2}$$
$$\Big( k-\dfrac{1}{2} \Big)^2 \leq 2n < \Big(k +\dfrac{1}{2}\Big)^2$$
$$\dfrac{1}{2}\Big( k-\dfrac{1}{2} \Big)^2 \leq n < \dfrac{1}{2}\Big(k +\dfrac{1}{2}\Big)^2$$
$$\dfrac{1}{2}\Big( k-\dfrac{1}{2} \Big)^2 + k - 1 \leq n + k -1 < \dfrac{1}{2}\Big(k +\dfrac{1}{2}\Big)^2 + k - 1$$
$$\Big( k-\dfrac{1}{2} \Big)^2 + 2k - 2 \leq 2(n + k -1) < \Big(k +\dfrac{1}{2}\Big)^2 + 2k - 2$$
$$k^2 - k + \dfrac{1}{4} + 2k - 2 \leq 2(n+k - 1) < k^2 + k + \dfrac{1}{4} + 2k - 2$$
$$k^2 + k + \dfrac{1}{4} - 2 \leq 2(n+k - 1) < k^2 + 3k + \dfrac{9}{4} - \dfrac{9}{4} + \dfrac{1}{4} - 2$$
$$\Big( k+\dfrac{1}{2} \Big)^2 - 2 \leq 2(n+k - 1) < \Big( k+\dfrac{3}{2} \Big)^2 - 4$$
From here $2(n+k - 1) < \Big( k+\dfrac{3}{2} \Big)^2 - 4 \implies 2(n+k - 1) < \Big( k+\dfrac{3}{2} \Big)^2$ so I can take the square root of both sides. The problem is the left hand side, $\Big( k+\dfrac{1}{2} \Big)^2 - 2 \leq 2(n+k - 1)$ does not imply $\Big( k+\dfrac{1}{2} \Big)^2 \nleq 2(n+k - 1)$, thus we can't really get rid of the square.
It is easy to see that if we have $k = a_{n+k}=\lfloor \sqrt{2(n+k)} + \dfrac{1}{2}\rfloor$, the problems we encountered are avoided, but $k \neq a_{n+k}$.
 [/INST] I am trying this question in a different way.
As is evident from series interger 1 occurs first time at 1 st position
integer 2 occurs first time after first term (1 + 0)
integer 3 occurs for the first time after (0 +1 + 2 ) terms
integer 4 occurs after (0 + 1 + 2 + 3 ) terms
so integer k will be present after (k(k-1)/2) terms, which means at [k(k-1)/2 + 1]th position
so if [k(k + 1)/2 + 1]th term is k 
then for nth term n=k(k+1)/2 + 1.
Just express k in terms of n.
I did not try it so i don't know if this is correct
</s>