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 = 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,\)