This is LaTeX code:

[latex]
S_n^1 = \frac{\left(n+1\right)^2 - S_n^0 - 1}{2} = \frac{n\left(n+1\right)}{2}
[/latex]