How would I write a math equation for this situation

I’m not sure if this is calculus or something else.

You have a set of numbers. Each number is the previous number plus 7. You want to sum the sets.

Let’s say you have four sets. That is 7 + 14 + 21 + 28. This gives an answer of 70.

What equation do you use if the number of sets and the consistent value they increase by varies from situation to situation? Assume the next problem is seven sets and each increases by 9.

Let the step size be called s, and the number of sets n. Then the total is given by sn(n+1)/2.

If you’d like to learn more on the subject it may be helpful to know that this concept has a name.

Arithmetic Sequence

I’ll take a crack at this (and undoubtably will be ninza’d by others while I type this out)…

Let’s call your increment value I (I = 7 in your first example, 9 in your second).

Let’s call your number of sets N (N = 4 in your first example, 7 in your second).

I don’t know how to write the mathematical symbol for summation in text form, so I’ll just refer to the basic equation as:

X = sum(M = 0 through N) of the value MI (EG, (0+ 1I + 2*I + … + (N-2)*I + (N-1)I + NI)

Note that there are exactly N+1 items to sum and that the sum of the Jth value and the (N-J)th value is always (J*I)+(N-J)I)=NI.

If N is odd, we have exactly (N+1)/2 such pairs, making the total result (NI)((N+1)/2).

If N is even, calculate the sum of the first (N-1) values as ((N-1)I)(N)/2) and add the last value (N*I). You end up with the same result.

So for N values incrementing by I you get the result

(NI)(N+1)/2

(ETA: and I was. Twice.)

nm. I was getting some info confused. Thanks Chronos, and everyone else.

If you’re interested in the “where does that equation come from,” consider your first sequence:

7 + 14 + 21 + 28

Sum the largest and smallest number. 7 + 28 = 35.

Sum the next-largest and next-smallest. 14 + 21 = 35.

So each pair sums to 35.

Next, how many pairs do you have? Since you have 4 numbers, you have 4/2 = 2 pairs. So 2*35 = 70 is the sum of all of them.

Of course, this idea is only useful if you know the sum of any pair, usually the first and last, but those are relatively easily determined if you know the starting number and the step.

Another quick example: 9, 18, 27, … and you have 13 numbers altogether.

The last number is 9*13 = 117.

Each pair sums to 117 + 9 = 126.

You have 6.5 pairs (since you have an odd number of numbers.)

126 * 6.5 = 819.

Seems to me the easiest way is to realize you’re just multiplying the sum of all numbers from 1 to x by a constant, and then remembering or deriving that old formula.

I agree, but you don’t even need to remember the formula for an arithmetic sequence.

Wesley Clark, what you described in the OP is summing the numbers 1, 2, 3, and 4, then multiplying that by seven. What you described is all based on adding up the first n integers, then multiplying that by a constant.

How do you add up the first n integers? First, picture kids’ building blocks, and you have one row of one, the second row has two, the next row has three, and the last row has four. How many total are there? Realize that you can arrange these in a triangle, and that triangle is half of a rectangle. For four rows, the rectangle would be four by five, right? And four by five has twenty blocks. So half of that would be ten blocks -> therefore the sum of the first four integers is 10. You can generalize that: for the first n integers, the sum would be n times (n+1), then half that: n*(n+1)/2.

That visualization makes some sense to me. Here is my question though. If the area of a rectangle is lh, and if you draw a diagonal line from one edge to another, the area of the triangle is (lh)/2.

If you assume the area under the diagonal wedge is a collection of columns, then you need the number of columns and their height. So with seven columns increasing in value by six each, you get the height by multiplying the number of columns by the value they increase.

Sn = h. N=l. So converting from lh and only doing half the rectangle the equation is snn/2.

How does the +1 come into play? Why is the equation sn(n+1)/2 and not (snn)/2

Two answers.
(1) if you substitute ‘n’ for the correct ‘n+1’, you end up counting only 1/2 of the (area of the) tiles along the diagonal.
(2) if you substitute ‘n’ for the correct ‘n+1’, you end up with an answer that is not a whole number whenever s and n are both odd. Clearly that can’t be right. :cool:

You can think of it this way: the average of all the terms you’re adding is halfway between the first term and the last term (by obvious symmetry). That is, the average is (first term + last term)/2, and so, the total sum is (first term + last term)/2 * number of terms.

What’s more, if you know the first term, you can derive the last term from it: last term = first term + step size * number of terms.

Thus, once you know the first term, step size, and number of terms, you can quickly compute the total sum.

Your visualization isn’t complete:

Two sets of 1, 2, 3, and 4:

O-OOOO
OO-OOO
OOO-OO
OOOO-O

Stick them together and notice that it’s a 4x5 rectangle.

Is there where the +1 comes from, you need one more set to have the complete length of the rectangle?

Yes. When you put the two triangles together, the row with n is going to be the same row as the 1 of the other triangle.