Formula for adding all positive integers in a given interrval?

Click For Summary

Homework Help Overview

The discussion revolves around finding a formula to sum all even integers within a specified interval, specifically between two points such as 6 and 2000. Participants are exploring the concept of arithmetic series as it applies to this problem.

Discussion Character

  • Exploratory, Conceptual clarification, Mathematical reasoning

Approaches and Questions Raised

  • Participants discuss the derivation of a formula for summing even integers and reference existing formulas for arithmetic series. There is curiosity about how to generalize the formula without needing to know the total number of integers in advance.

Discussion Status

The conversation is active, with participants sharing insights about the relationship between the derived formula and established arithmetic series formulas. Some guidance has been offered regarding the general formula for arithmetic sums, but there is no explicit consensus on a single approach.

Contextual Notes

Participants are considering the implications of their findings for algorithms, particularly in scenarios where the number of integers to sum is unknown. There is an emphasis on the specific case of summing even integers, which may influence the applicability of general formulas.

sherrellbc
Messages
83
Reaction score
0

Homework Statement

I meant for the title to be, Sum of all EVEN integers
A formula to add all even integers between two given points.
(i.e.) All integers from 6 to 2000 ?
6+8+10+12 .. + 2000

The Attempt at a Solution


The reason I ask is because I derived such an equation that will work for any integer interval. Just curious to see what any similar formula would look like.

Surely there is something like this.
 
Last edited:
Physics news on Phys.org
sherrellbc said:

Homework Statement




I meant for the title to be, Sum of all EVEN integers
A formula to add all even integers between two given points.
(i.e.) All integers from 6 to 2000 ?
6+8+10+12 .. + 2000

The Attempt at a Solution


The reason I ask is because I derived such an equation that will work for any integer interval. Just curious to see what any similar formula would look like.

Surely there is something like this.

Surely there is. It's just the sum of an arithmetic series. See https://en.wikipedia.org/wiki/Arithmetic_progression
 
Dick said:
Surely there is. It's just the sum of an arithmetic series. See https://en.wikipedia.org/wiki/Arithmetic_progression

Interesting. The Arithmetic series illustrates on this page is pretty much exactly what I derived, although mine being for a special case of the constant difference being two.

The difference being that the equations given on the Wiki article assume that you know how many integers you are adding together; the formula I derived does not. I simply expanded on this notion of needing to know the total number of integers to add and derived a generalized form of it. So, that being said, its already exists. Anyway, here is what I came up with. Given a closed interval [a,b] of positive integers, the sum is nothing more than:
RCJXDuD.jpg
 
This could be extensively useful in algorithms. Perhaps you are not aware of the length of Integers to add.

Albeit very specific, the formula could be useful.
 
If you look further down, there's the more general formula for an arithmetic sum where the difference between each value is d (in your case, 2)

[tex]S_n = \frac{n}{2}\left(2a+(n-1)d\right)[/tex]

With d=2 we get

[tex]S_n = \frac{n}{2}\left(2a+2n-2\right)[/tex]

[tex]=n(a+n-1)[/tex]

But if you want the formula to be in terms of only the first and last values of the series, then you'll get to the result you've shown.
 

Similar threads

  • · Replies 16 ·
Replies
16
Views
3K
  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 4 ·
Replies
4
Views
3K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 6 ·
Replies
6
Views
2K
  • · Replies 20 ·
Replies
20
Views
3K
  • · Replies 17 ·
Replies
17
Views
3K
  • · Replies 10 ·
Replies
10
Views
3K
  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 3 ·
Replies
3
Views
2K