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 !!
Asked
Active
Viewed 3.1k times
6
Gerry Myerson
- 179,216
Amritanshu
- 961
-
1It took me ten minutes to understand the question. Your error is probably in the interpretation of b/w. – Jun 28 '16 at 06:44
-
4Are you counting $\alpha$ in your sum? If so, then you need to replace $\alpha$ by $\alpha-1$ in your formula. To see why this is, consider the sum of the numbers between $2$ and $3$. This is $2+3=5$. this can be written as $(1+2+3)-1$. In the proof, however, you seem to have assumed that this is $(1+2+3)-(1+2)$ which gives the incorrect answer of 3, not 5. – Nathaniel B Jun 28 '16 at 06:47
-
So can you tell me the fully revised formula then – Amritanshu Jun 28 '16 at 06:49
-
@Amritanshu if you need the sum between $\alpha$ and $\beta$ including both, you need to replace $\alpha$ by $\alpha-1$. If you wish to exclude both, you need to replace $\beta$ by $\beta-1$. – GoodDeeds Jun 28 '16 at 06:51
-
You are so close. 1) is the some of the numbers including 1 and alpha. Two is the sum to beta. So subtracting them is the sum from alpha +1 to beta. This is probably not what you want. You probably want either from alpha +1 to beta -1. Or from alpha to beta. – fleablood Jun 28 '16 at 09:13
-
What exactly does b/w mean? If you think that out you will get it. – fleablood Jun 28 '16 at 09:15
-
b/w is the short form of between – Amritanshu Jun 28 '16 at 16:16
1 Answers
13
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.