The sum of consecutive integers from a to b is an arithmetic series: it equals the number of terms times the average of the first and last value, sum = n × (a + b) ÷ 2. For the special case 1 to n this becomes n(n + 1)/2. This calculator returns the total, the term count, and the average.
Reviewed: June 20, 2026 · Author: Naveen P N, Founder — AI Calculator · Verified against: arithmetic series formula, recomputed in code.
The formula
The idea is Gauss's pairing trick: line up the range and add the smallest to the largest, the next-smallest to the next-largest, and so on. Every pair sums to a + b, and there are n/2 pairs, giving n(a + b)/2. Because the average of an evenly spaced list is just the midpoint of its ends, the sum is simply count × average.
Worked examples
1 to 100:
5 to 15:
−3 to 3 (symmetric):
The average is always the midpoint of the two ends, so for 1 to 100 it's 50.5 and for 5 to 15 it's 10. A symmetric range around zero, like −3 to 3, sums to 0 because the positives and negatives cancel.
Frequently Asked Questions
sum = n × (a + b) ÷ 2, with n = b − a + 1. 5 to 15: 11 × 20 ÷ 2 = 110.
5050, from 100 × 101 ÷ 2 — Gauss's famous result.
n(n+1)/2. For n = 10: 10 × 11 ÷ 2 = 55.
Each first+last pair sums to a + b, and there are n/2 pairs → n(a+b)/2.
Yes. −3 to 3 has 7 terms summing to 0, with average 0.