Sum of Consecutive Integers Calculator
Add up a run of consecutive whole numbers from a start to an end value using Gauss’s pairing formula.
How it works
Sum = (first + last) × count ÷ 2 · count = last − first + 1 · for 1…n this is n(n+1) ÷ 2
Consecutive integers form an arithmetic series, so their total is the average of the first and last term multiplied by how many terms there are. The pairing trick Gauss famously used — matching the smallest with the largest, and so on — shows why (first + last) × count ÷ 2 works. When the run starts at 1 it reduces to the triangular-number formula n(n+1)/2.
Worked example
Summing 1 to 100: the count is 100, and (1 + 100) × 100 ÷ 2 = 101 × 50 = 5,050 — the answer the young Gauss reportedly gave in seconds.
Sources: Arithmetic progression — Wikipedia
Frequently asked questions
Does the run have to start at 1?
No. You can sum any consecutive range, such as 50 to 60. The formula uses the first and last values directly, so it works for any starting point.
Can I use negative numbers?
Yes. Summing from −5 to 5, for instance, the symmetric terms cancel and the total is 0. The formula handles negative starts as long as the end is not below the start.
Why does the formula divide by 2?
Pairing the first and last terms gives a constant total (first + last), and there are count ÷ 2 such pairs. Multiplying and simplifying yields (first + last) × count ÷ 2.
Related calculators
This calculator is for educational purposes. Double-check important results before acting on them.