What does the math notation $\sum$ mean?

Here I use it once to explain what it does.

$$\sum_{i=1}^{5} i=1+2+3+4+5$$

Which translates to, sum over $i$, where $i$ starts at $1$ and goes to $5$. or this case

$$\sum_{i=1}^{5} i^2=1^2+2^2+3^2+4^2+5^2$$

Which translates to sum over the values of $i$, which range from $1$ to $5$ the function $i^2$.

Naturally one may wonder what if it is a product we are after, for example how do I represent $1\times2\times3\times4\times5$ or $1^2\times2^2\times3^2\times4^2\times5^2$

The notation for those are

$$\prod_{i=1}^5 i $$

and

$$\prod_{i=1}^5 i^2 $$


Coming from a programming background, I found it quite helpful to explain it using a for loop:

The mathematician would write it like this:

$\sum\limits_{i=m}^n f(i)$

And the programmer would write it like this:

result = 0
for (i=m; i<=n; i++) {
    result += f(i)
}

You can think of m as the start index and n as the end index.