I was trying to come up with a formula for some numbers I was working with on Excel. I have one value (x) and another value (y). I need to add x + (x + y) + (x + y*2) + (x + y*3) + (x + y*4).... and this continues on. What I came up with in Excel was -
(x + (x + y*(n-1)))* n / 2
Is this a known formula? I guess Im trying to understand what I stumbled into. Is there an easier way to solve these x and increasing y problems?
(x + (x + y*(n-1)))* n / 2
Is this a known formula? I guess Im trying to understand what I stumbled into. Is there an easier way to solve these x and increasing y problems?
-
You've essentially stumbled onto the triangular number formula. Your series is called an arithmetic progression. The sum of such a progression has been known for at least 1500 years (see my source; the formula appears in the ancient Aryabhatiya).
Edit in response to added details:
Is there an easier formula? Yes, the way you've written the answer isn't the nicest. The page I linked on arithmetic progressions uses an essentially equivalent formula, which in your case is
8/2 * ($10 + $17) = $108
Another way is
8/2 * ($10 + $10 + $7)
8 * $10 + 8/2 * $(8-1) = $108
A general formula is n/2 * (a1 + an) where n is the number of terms, a1 is the first, and an is the last. There are many modifications to the formula that you've given, which I consider very minor. This last form seems very simple to me; I doubt anything you would consider simpler exists.
Edit in response to added details:
Is there an easier formula? Yes, the way you've written the answer isn't the nicest. The page I linked on arithmetic progressions uses an essentially equivalent formula, which in your case is
8/2 * ($10 + $17) = $108
Another way is
8/2 * ($10 + $10 + $7)
8 * $10 + 8/2 * $(8-1) = $108
A general formula is n/2 * (a1 + an) where n is the number of terms, a1 is the first, and an is the last. There are many modifications to the formula that you've given, which I consider very minor. This last form seems very simple to me; I doubt anything you would consider simpler exists.
-
Besides this being an obvious "Sequence", not really.
However, did you mean y^2 or y*2? Is the y increasing by a "multiple" or by a "power"?
In either case, realize that you don't have to have such a complicated equation like the one you posted.
Assuming n = 1:
As a Multiple: Sigma [ x + (n - 1)y ]
As a Power: Sigma [ x + y^(n - 1) ]
Where "Sigma" is the mathematical operator for "summation" as n increases. Excel has the actual Sigma Symbol which is labeled the sum() function, looks like a funny capitol E.
However, did you mean y^2 or y*2? Is the y increasing by a "multiple" or by a "power"?
In either case, realize that you don't have to have such a complicated equation like the one you posted.
Assuming n = 1:
As a Multiple: Sigma [ x + (n - 1)y ]
As a Power: Sigma [ x + y^(n - 1) ]
Where "Sigma" is the mathematical operator for "summation" as n increases. Excel has the actual Sigma Symbol which is labeled the sum() function, looks like a funny capitol E.
-
Define a sequence
a(n) = x+n*y
Then, the sum is simply the sum of a(n) from 0 to N.
Thus,
S(N) = x + (x + y) + (x + y*2) + ... (x + y*N)
= (N+1)*x + y*(0+ 1 + ... * N)
= (N+1)*x + y*(N*(N+1)/2
where I have used the fact that
1+ 2 + ... N = N(N+1)/2
a(n) = x+n*y
Then, the sum is simply the sum of a(n) from 0 to N.
Thus,
S(N) = x + (x + y) + (x + y*2) + ... (x + y*N)
= (N+1)*x + y*(0+ 1 + ... * N)
= (N+1)*x + y*(N*(N+1)/2
where I have used the fact that
1+ 2 + ... N = N(N+1)/2