A formula for the $n$th term of a sequence 
Find a formula for the $n$th term of the sequence
  $$1,2,2,3,3,3,4,4,4,4,\ldots.$$

Let $x_n$ denote the $n$th term of the sequence. If
$$1+2+\cdots+m < n \leq 1+2+\cdots+m+(m+1)$$
then $x_n = m+1$. Is this a formula or not?

This is not considered a formula, because it does not give $x_n$ as a function of $n$ but instead gives (sharp) bounds on what $x_n$ is. Instead, note that


*

*$x_1=1=T_1$ and it is the last $x_n$ equal to 1

*$x_2=3=T_2$ and it is the last $x_n$ equal to 2

*$x_3=6=T_3$ and it is the last $x_n$ equal to 3, etc.


Here $T_n$ is the $n$th triangular number. There is an analogue of the square root – the triangular root – that yields $n$ given $T_n$:
$$n=\frac{\sqrt{8T_n+1}-1}2$$
Therefore a possible formula for $x_n$ is
$$x_n=\left\lceil\frac{\sqrt{8n+1}-1}2\right\rceil$$
Alternatively, this sequence is A002024 in the OEIS and a simpler formula given there is
$$x_n=\left\lfloor\sqrt{2n}+\frac12\right\rfloor$$
