Sigma Summation Notation

It it sometimes necessary to consider sums with many summands — sometimes indefinitely many summands, and sometimes even infinitely many summands. To not be encumbered by such unwieldy sums we use a concise notation, sigma summation notation.

\[ \sum_{i=1}^{n} f(i) = f(1) + f(2) + f(3) + \dotsb + f(n\!-\!1) + f(n) \]
The sum of the numbers \(f(i)\) counting from index \(i\!=\!1\) up to \(i\!=\!n\)

sum = 0
for(i = 1; i <= n; i++) {
    sum += f(i)
}

The notation is so-named because it involves the capital Greek letter Σ (sigma) for “Σummation”. Sigma notation is linear in the sense that it breaks across sums/differences and constants factor out: \(\sum \bigl(a_i \pm b_i\bigr) \!=\! \sum a_i \!\pm\! \sum b_i\) and \(\sum k a_i \!=\! k \sum a_i\,. \)

There are closed-form formulas, Faulhaber’s formulas, for the sums of the powers of the first \(n\) whole numbers. For the powers \(1,\) \(2,\) and \(3,\)

\(\displaystyle \sum_{i=1}^{n} i = \frac{n(n+1)}{2} \)
\(\displaystyle \sum_{i=1}^{n} i^2 = \frac{n(n+1)(2n+1)}{6} \)
\(\displaystyle \sum_{i=1}^{n} i^3 = \biggl(\frac{n(n+1)}{2}\biggr)^{\!2} \)