Skip to main content
🔢 Series

Sum of Consecutive Integers Calculator

Add every whole number from one value to another. Get the total, the count of terms, and the average — with the arithmetic-series formula shown.

Sum a to b
1 to n shortcut
Term count
Average
100% Free
🔢 Open All Math Calculators 📖 Read the Guide

Sum of integers — Quick answer

Multiply the number of terms by the average of the first and last.

sum = n × (a + b) ÷ 2  where  n = b − a + 1  ·  1…n = n(n+1)/2

Worked example: 1 to 100 → 100 × 101 ÷ 2 = 5050.

Examples

RangeTermsSum
1 to 101055
5 to 1511110
1 to 10001000500500

The average is just the midpoint (a + b) ÷ 2.

🔢 Sum of Consecutive Integers

Enter the first and last whole number of the range.

Sum
Number of terms
Average
Range

ℹ️ Both endpoints are included. If you enter them in reverse order, they're swapped automatically.

Standards & method

✓ Independently verified 12 July 2026
Basis
First principles
Method
Gauss’s summation formula for an arithmetic series.
Core formula
Σ(1..n) = n(n+1)/2  ·  general: S = n(a₁ + aₙ)/2
Why this matters
Closed form — no loop needed. The sum of the first n integers grows with n², not n, which is why naive O(n²) algorithms blow up.
Independently verified
12 July 2026 — Formula re-derived from first principles and verified numerically against hand-computed reference cases, including edge cases and unit handling.

Results are for guidance. Verify against the current edition of the governing standard and have a qualified professional review before use in practice.

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

Arithmetic series
sum = n × (a + b) ÷ 2,   n = b − a + 1   (and 1…n = n(n+1)/2)

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:

Gauss's sum
n = 100 · (1 + 100) ÷ 2 = 50.5 · 100 × 50.5 = 5050

5 to 15:

11 terms
n = 15 − 5 + 1 = 11 · 11 × (20) ÷ 2 = 110

−3 to 3 (symmetric):

Cancels to 0
7 terms · midpoint 0 · 7 × 0 = 0

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

How do I sum integers from a to b?

sum = n × (a + b) ÷ 2, with n = b − a + 1. 5 to 15: 11 × 20 ÷ 2 = 110.

What is the sum of 1 to 100?

5050, from 100 × 101 ÷ 2 — Gauss's famous result.

What is the 1 to n formula?

n(n+1)/2. For n = 10: 10 × 11 ÷ 2 = 55.

Why does the pairing trick work?

Each first+last pair sums to a + b, and there are n/2 pairs → n(a+b)/2.

Can it include negatives?

Yes. −3 to 3 has 7 terms summing to 0, with average 0.

Need more math tools?

Explore arithmetic and geometric sequences, midrange, quotient & remainder and more across the AI Calculator math suite.

🔢 Open Math Calculators — Free

No registration required · 350+ calculators · PDF report export