A programmer’s proof of the triangular numbers

TriangularNumbersHeaderImage

The triangular numbers are an interesting mathematical phenomenon that appears constantly in computer science. When you, the programmer, talk about the Big-Oh complexity of a nested for loop that gets executed 1 + 2 + \ldots + n times, you might just slap O(n^2) on it and call it a day.

But do you ever think about what that summation actually is? In this article I’ll present an alternative formulation of the series that I think is satisfying from a programmer’s point of view, and also present some interesting results from looking at the series in different ways.

Continue reading “A programmer’s proof of the triangular numbers”