This is LaTeX code:
[latex]
S_n = \frac{n(a_1 + a_n)}{2}
[/latex]