TITLE: Reversing the $T(n) = \frac{n(n+1)}{2}$ formula
QUESTION [5 upvotes]: Can someone reverse this formula? Sorry if it's too basic, I'm an old guy and my math is rusty :-D
$s =\frac{n(n+1)}{2}$
If it ain't clear, by reverse I mean obtaining the value of n by providing s
Thanks

REPLY [7 votes]: $$s= \frac{n^2+n}{2}$$
$$n^2+n-2s=0$$
This is a degree two polynomial equation in the variable $n$, whose positive solution is
$$n= \frac{-1 + \sqrt{1+8s}}{2}$$