# How do you solve for n in S = (n(n+1))/ 2?

Jun 7, 2016

$n = \frac{- 1 \pm \sqrt{1 + 8 S}}{2}$

#### Explanation:

$S = \frac{n \left(n + 1\right)}{2}$

$S = \frac{{n}^{2} + n}{2}$

$2 S = {n}^{2} + n$

${n}^{2} + n - 2 S = 0$

using the quadratic formula for : $a {x}^{2} + b x + c = 0$,

$n = \frac{- b \pm \sqrt{{b}^{2} - 4 a c}}{2 a}$

$n = \frac{- 1 \pm \sqrt{1 - 4 \left(1\right) \left(- 2 S\right)}}{2}$

$n = \frac{- 1 \pm \sqrt{1 + 8 S}}{2}$