TITLE: Finding the sum of numbers between any two given numbers
QUESTION [5 upvotes]: I tried to derive this type of formula and ended up with this . But it's not holding true for all the numbers. Can you please tell what I've done wrong !!

REPLY [10 votes]: Between $\alpha$ and $\beta$, there are $\beta - \alpha + 1$ numbers. We need
\begin{align*}
S &= \alpha + (\alpha + 1) + \cdots + \beta \\
&= \beta + (\beta - 1) +\cdots + \alpha
\end{align*}
Adding vertically, we have 
\begin{equation*}
2S = (\beta-\alpha+1)(\alpha+\beta)
\end{equation*}
Hence
\begin{equation*}
S = \frac{(\beta-\alpha+1)(\alpha+\beta)}{2}
\end{equation*}
This "reverse and add" technique is due to Gauss and can be used to sum any arithmetic progression as well.