Calculate the sum of all numbers, odd numbers, or even numbers between two integers. See the numbers included, the arithmetic-series formula, and a step-by-step calculation.
A conditional sum adds only the numbers that satisfy a specified condition. Instead of adding every integer in a range, you can restrict the calculation to odd numbers, even numbers, or include all integers.
For example, between 1 and 10:
This type of calculation is useful when working with sequences, arithmetic progressions, sigma notation, number patterns, and discrete mathematics.
When every integer in the range is included, the numbers form an arithmetic sequence with common difference \(1\).
The number of terms is
Therefore, the familiar arithmetic-series formula \(n(a+b)/2\) gives the same result.
Odd integers are numbers that are not divisible by 2. Consecutive odd numbers differ by \(2\).
The sum of the first \(n\) positive odd numbers has the particularly simple formula
For example, the first five odd numbers sum to
Even integers are divisible by 2 and form the sequence
The sum of the first \(n\) positive even numbers is
For example,
Both odd and even numbers form arithmetic sequences. This makes arithmetic-series formulas useful for conditional summation.
The general sum of an arithmetic sequence is
Here:
For all consecutive integers, \(d=1\). For odd or even integers, \(d=2\).
| Range | Condition | Numbers | Sum |
|---|---|---|---|
| 1–10 | All | 1, 2, 3, …, 10 | 55 |
| 1–10 | Odd | 1, 3, 5, 7, 9 | 25 |
| 1–10 | Even | 2, 4, 6, 8, 10 | 30 |
| 5–15 | Odd | 5, 7, 9, 11, 13, 15 | 60 |
| 5–15 | Even | 6, 8, 10, 12, 14 | 50 |
Sigma notation provides a compact way to represent a sum. A condition can be included by specifying which values of the index are allowed.
For all integers in a range:
For odd integers, the terms can be represented as \(2k+1\):
For even integers, the terms can be represented as \(2k\):
Continue exploring sums, sequences, and number patterns with these Summe calculators:
Evaluate mathematical sums written in sigma notation.
Calculate finite series and sequence sums.
Work specifically with sums of odd integers.
Calculate sums involving even integers.
Calculate sums of squared integers.
Calculate sums of consecutive cubes.
Calculate the sum of prime numbers in a range.
Calculate running and cumulative sums.
Calculate sums of powers such as squares and cubes.
Explore sums of consecutive positive integers.
A conditional sum includes only the numbers that satisfy a specified condition. In this calculator, the available conditions are all numbers, odd numbers, and even numbers.
If the range is from \(a\) to \(b\), the sum is \(\frac{(b-a+1)(a+b)}{2}\).
The sum of the first \(n\) positive odd numbers is \(n^2\): \[ 1+3+5+\cdots+(2n-1)=n^2. \]
The sum of the first \(n\) positive even numbers is \(n(n+1)\): \[ 2+4+6+\cdots+2n=n(n+1). \]
Yes. The calculator accepts whole numbers, including negative integers, provided that the start number is not greater than the end number.
The calculator reports a sum of zero because no numbers satisfy the selected condition.
Yes. Consecutive odd numbers and consecutive even numbers both have a common difference of \(2\). Therefore, arithmetic-series formulas can be used to calculate their sums.
A regular range sum includes every integer in the interval. A conditional sum filters the interval first and includes only numbers satisfying the selected condition.