This is a simple arithmetic progression the sum of which is given by n(a + b)/2, where n is the number of terms, a is the first term and b is the last term. So, assuming you mean between 22 and 41 inclusive:
$${\mathtt{sum}} = {\frac{{\mathtt{20}}{\mathtt{\,\times\,}}\left({\mathtt{22}}{\mathtt{\,\small\textbf+\,}}{\mathtt{41}}\right)}{{\mathtt{2}}}} \Rightarrow {\mathtt{sum}} = {\mathtt{630}}$$
im sorry alan but i couldnt understand ur answer properly ! pls could u explain much more clearly !
The goal is to add up all the numbers from 22 to 41 inclusive. Sum = 22 + 23 + ... + 40 + 41.
This is an arithmetic progression. More generally, we might have:
Sum = a + (a+d) + (a+2d) + ... (a+(n-3)d) +(a+(n-2)d)+(a+(n-1)d)
where there are n terms, the first of which is "a" and the same difference, "d", is added on to each successive term.
Let's rewrite the sum and below it write the same thing, but with the terms written in reverse order:
Sum = a + (a+d) + (a+2d) + ... + (a+(n-3)d) +(a+(n-2)d)+(a+(n-1)d)
Sum = (a+(n-1)d)+ (a+(n-2)d) + (a+(n-3)d) +... + (a+2d) + (a+d) + a
Now add up the two series term by term:
2*Sum = (2a+(n-1)d) + (2a+(n-1)d)+(2a+(n-1)d)+ ... +(2a+(n-1)d)+(2a+(n-1)d)+(2a+(n-1)d)
or, setting b = a+(n-1)d, the last term in the original series, we have:
2*Sum = (a+b) + (a+b) + (a+b) + ... + (a+b) + (a+b) + (a+b)
There are n terms on the right-hand side, all equal to a+b, so
2*Sum = n(a+b)
so that
Sum = n(a+b)/2
In the original question, n = 20, a = 22 and b = 41.
Does this make it clearer?
To be doubly clear, let me do the calculation with the numbers:
Sum = 22 + 23 + 24 + ... + 39 + 40 + 41
Sum = 41 + 40 + 39 + ... + 24 + 23 + 22
Add up these two:
2*Sum = 63 + 63 + 63 + ... + 63 + 63 + 63
There are 20 lots of 63 on the right-hand side, so
2*Sum = 20*63
Sum = 20*63/2 = 10*63 = 630
Note that 63 can be written as 22 + 41 (i.e. first + last).
So we could write Sum = 20*(22+41)/2
Here's another way this could be done, rosala..it maybe isn't quite as nice and neat as Alan's, but it still "works"
The sum of the first n positive integers is just given by n*(n+1)/2
So, the sum of the first 41 integers is just 41*42/2
And the sum of the first 21 integers is just 21*22/2
So subtracting the second from the first, we get 41*42/2 - 21*22/2 .... or just......
(41*42 - 21*22)/2 = 1260/2 = 630
Note, that what we are really doing - in non-mathematical terms - is just taking the sum of the first 41 positive integers and "lopping off" the sum of its first 21 terms......so we have 22+23+24+25+.....+41 = 630
-----------------------------------------------------------------------------------------------------
Finally, rosala.....if you only want to work with the numbers themselves and not have to remember any "n's," etc., here's one more method.....(it's really Alan's in disguise!!)
(Subtract the two numbers and add 1)
(Add the two numbers)
Multiply the first thing times the second and divide by two
So we have (41-22+1)(22+ 41) /2 = 20(63)/2 = 630.....no real "formulas" to remember....only a procedure.....whether this is "better" or "worse"...???.....I'll leave that up to you!!!
----------------------------------------------------------------------------------------------------
P.S. - Does the questioner want all sum of all the terms from 22 to 41 or between 22 and 41 ???.........well, no mind....we've given him/her a few different methods to achieve the second...
$${\mathtt{41}}{\mathtt{\,-\,}}{\mathtt{22}}$$ Thats all you gotta do.Simple.
P.S I'm not counting decimals.
between means
$${\mathtt{23}}{\mathtt{\,\small\textbf+\,}}{\mathtt{24}}{\mathtt{\,\small\textbf+\,}}{\mathtt{25}}{\mathtt{\,\small\textbf+\,}}{\mathtt{26}}{\mathtt{\,\small\textbf+\,}}{\mathtt{27}}{\mathtt{\,\small\textbf+\,}}{\mathtt{28}}{\mathtt{\,\small\textbf+\,}}{\mathtt{29}}{\mathtt{\,\small\textbf+\,}}{\mathtt{30}}{\mathtt{\,\small\textbf+\,}}{\mathtt{31}}{\mathtt{\,\small\textbf+\,}}{\mathtt{32}}{\mathtt{\,\small\textbf+\,}}{\mathtt{33}}{\mathtt{\,\small\textbf+\,}}{\mathtt{34}}{\mathtt{\,\small\textbf+\,}}{\mathtt{35}}{\mathtt{\,\small\textbf+\,}}{\mathtt{36}}{\mathtt{\,\small\textbf+\,}}{\mathtt{37}}{\mathtt{\,\small\textbf+\,}}{\mathtt{38}}{\mathtt{\,\small\textbf+\,}}{\mathtt{39}}{\mathtt{\,\small\textbf+\,}}{\mathtt{40}} = {\mathtt{567}}$$
Alan and CPhill have used good techniques that would be very useful if you needed to add up a much wider range of numbers.
Say you wanted the sum of all numbers between 100 and 1650.
that would be 101+102+.......+1649.
You wouldn't add them one at a time - it would take too long!
let it be , its getting me hard to understand ur ways CPhill and alan , ill just do it the simple ways but when big numbers come in my way ill surely come back to these methods ! but still melody , cphill and alan thumbs up from me ! thank u very much !
Rosala.....look at my second way, again....it's just simple math.....
1st .. Subtract 41-22 = 19 and add 1 = 20
2nd .. Add 41 + 22 = 63
3rd .. Multiply the "1st" times the "2nd"......(20)(63) = 1260
Now ..... divide that by 2 = 1260/2 = 630 !!
I know you can do that .... !!
Adding a long string of numbers is tedious.....and sometimes almost impossible.....this way is "easy-peezy"