This is LaTeX code:
[latex]
\frac{\sum_{k = 1}^{n-2}k}{n^2}=\frac{(n -1)(n - 2)}{2n^2}
[/latex]