The story of Gauss adding numbers together quickly is an important, if apocryphal, mathematical lore. Perhaps because it is apocryphal, perhaps because it involves the simplest of arithmetic operations, additions, it is often treated as nothing more than a parlor trick. But there is some interesting math behind it.

Lets generalize the results away from 1 to 100. In general, if our highest number is x, than each pair will add to x+1. And since we have half as many pairs as our x, we will multiple (x+1)(x/2). This gives us (x^2+x)/2. So for any given number, if we want to calculate the sum of its digits, we just square it, add x, and divide by two. Not that this is a particularly easy trick itself, squaring, say, 537 in our heads is not something we can do automatically. But it is certainly easier than the alternative.

There are a few interesting things about the expression (x^2+x)/2. First, as the number gets higher, the sum effectively becomes x^2/2. If you are interested in reciprocal sums, then, we know that since the denominator is squared, the sum has to converge. Since Leonhard Euler demonstrated that the sum of the reciprocal squares converges to pi squared divided by six, it might be guessed that this sum would converge to around 3. However, the early numbers make up an important part of its reciprocal sum, so it actually converged to...2. (I base this only on a spreadsheet of the first 10,000 or so terms, I have no mathematical proof or reasoning for why this would be.

The last paragraph might have been too densely mathematical for some, and too hastily reasoned for mathematicians, but the point is that something that seems like just a trick, that seems to have no wider application, can, using mathematical methods, be seen to fit a wider and more important pattern.

Note: after writing this, I have found that I have rediscovered "Triangular Numbers", and that these things are already known widely.