How do you do summation notation in MathJax? [closed]

For example, sum for every k from 0 to n.

How would I do this properly in MathJax format on a site that supports MathJax?

You can use the \sum' command:

$\sum_{k=0}^n k = \frac{n^2-n}{2}$


There's a Formatting Sandbox on Mathematics Meta where you can practice.

In order to get the preferred notation in accordance with ISO 80000-2, use

$$\sum\limits_{i = 1}^n {a_i}$$


However, the following notations are also used

$$\sum\nolimits_{i = 1}^n {a_i}$$

$$\sum\limits_i {a_i}$$

$$\sum\nolimits_i {a_i}$$

$$\sum {a_i}$$
`