Eines Tages gab es einen guten Mathematiker namens Carl Friedrich Gauß... I'm just kidding; this note won't be in German!
Legend says that there was a young German boy, perhaps ten to eleven years old (he was perhaps in the fourth or fifth grade), by the name of Carl Friedrich Gauss (1777 - 1855), who once added the numbers from $1$ to $100$ in no more than a few seconds. His teacher was a lazy man who enjoyed putting his students to work for long hours so that he could take a nap every once in a while. It is too bad for him that one of them so happened to be none other than the mathematical legend himself, the "prince of mathematicians"! The way that the boy solved this problem so quickly was by noticing a subtle pattern in the sum:
Adding all the numbers from $1$ to $100$ is a cumbersome task. I mean, really:$$\begin{align}1+2&=3,\\3+3&=6,\\6+4&=10,\\10+5&=15,\\\end{align}$$and so on. However, what young Friedrich did was add the numbers backward! Like this:$$\begin{align}1+100&=101,\\2+99&=101,\\3+98&=101,\\4+97&=101,\,\dots\end{align}$$He observed that all of them add up to $101$! As a result, all that he had to do was add this number $50$ times because:$$\dots\,50+51=101.$$This is the same thing as multiplying $50\times101$ to obtain $5,050$, which is the correct result.
That's it. That's all there is to it. Nevertheless, as mathematicians, we tend to be very fancy or "elegant". So, let's generalize this finding:
We want to add all the integers from $1$ to $n$. In other words, we want to know what$$\sum_{i=1}^{n}i=1+2+3+\cdots+n$$adds up to.
Straight from Gauss' problem, it's clear that he was adding to $100$ by multiplying $101$ by $50$. In other words, if we let $n=100$, then he just multiplied $n+1$ by $n\div2$. That's it! We just generalized the problem and can now claim that:$$\sum_{i=1}^{n}i=\frac{n(n+1)}{2}.$$From this expression, it follows that the sum of all the numbers from $1$ to $1,234,567$ is$$\frac{1,234,567(1,234,568)}{2}=762,078,456,028.$$I bet noticing this pattern saved our little fella some playground time.