Let T = number to test
T = n ( n + 1 ) 2 {\displaystyle T={\frac {n(n+1)}{2}}}
n 2 + n − 2 T = 0 {\displaystyle n^{2}+n-2T=0}
Find the roots of the quadratic. What value of n would make our T?
n = − 1 ± 1 2 − 4 ( 1 ) ( − 2 T ) 2 ⋅ 1 = − 1 ± 8 T + 1 2 {\displaystyle n={\frac {-1\pm {\sqrt {1^{2}-4(1)(-2T)}}}{2\cdot 1}}={\frac {-1\pm {\sqrt {8T+1}}}{2}}}
Only one of these two roots can be a positive result.
n = 8 T + 1 − 1 2 {\displaystyle n={\frac {{\sqrt {8T+1}}-1}{2}}}