144144
Hey all,
I know i can find it in the forums but i failed.
If I have a set with a constant d (difference between the numbers) i have 2 ways to calculate the sum of the items:
(a1+an)*n/2
and
2/n*(2*a1 + (n-1)*d)
can someone plz tell me what is the difference? which one u use when and why?
thanks.
You are right;
If you know the first and the last term and number of elements; you use the first one;
First sequence;
2,...............................,16
Number of Elements, n = 8
Common difference, d=2 (not required)
\(Sum = \frac{(a_1+a_n)}{2}*n\)
\(Sum = \frac{(2+16)}{2}*8 = 72\)
If the sequence is;
2,4,6...
Number of elements, n=8
Common difference, d=2
Here you don't know the last term
So; you use the latter
\(Sum = \frac{n}{2}(2a_1+(n-1)d)\)
\(Sum = \frac{8}{2}(2*2+(8-1)2) = 72\)
As you can see, the first one is easily found. You use the first on all evenly spaced set where first and last term are known. If you don't know both first and last term, the latter formula should be used.