TITLE: How to get inverse of formula for sum of integers from 1 to n?
QUESTION [11 upvotes]: I know very well that the sum of integers from $1$ to $n$ is $\dfrac{n\times(n+1)}2$. What I'm interested in today, and cannot find a solution for, is performing the opposite operation.
Let $m = \dfrac{n^2 + n} 2$. Knowing the value of $m$, how do I figure out the value of $n$? I could easily program a solution but I'd much prefer an algebraic one.

REPLY [11 votes]: You have got that $m = \dfrac{n^2 + n} 2$ which will give you $2m=n(n+1)$. 
You can make a quadratic equation  $n^2+n-2m=0$. On solving the quadratic equation you get that $n=\frac{-1 \pm\sqrt{1+8m}}{2}$.  Now solve this (as you know the $m$, you can easily find $n$) and eliminate the negative solution (As $n$ can not be negative).