Summation Calculator
Sum, terms, and average for 1 through any n.
What it does
Adding 1 through n folds neatly: pair 1 with n, 2 with n-1, and every pair sums to n+1 across n/2 pairs. Gauss spotted this as a schoolboy for 1 to 100, answering 5,050 before the class finished writing.
The tool above takes n from 1 to one hundred million. It returns the total with term count and average term beside them.
The default 100 gives 100x101/2 = 5,050 over 100 terms averaging 50.5. A thousand runs 500,500 the same way, no looping required.
The formula follows Khan Academy series units with the same pairing proof in LibreTexts math references. Both cap exact integer display where doubles hold every digit.
How to use
- Enter the last number n.
- Read total first for the sum.
- Read terms for the count added.
- Use average for the middle value.
- Split bigger ranges into chunks.
Formula
- n
- Last whole number added from 1.
- /2
- Pair averaging across the range.
- pairs
- n/2 groups each worth n+1.
Whole n from 1 to 100,000,000 accepted; exact integers hold through the cap. Ranges starting elsewhere subtract two prefix sums.
Worked example
Example: 1 to 100
Default n 100.
- Plus one: 100 + 1 = 101.
- Halve pairs: 100 / 2 = 50 pairs.
- Total: 50 x 101 = 5,050.
- Average: 101 / 2 = 50.5.
- Tool shows 5,050, 100 terms, 50.5.
Reference table
| n | Total | Average |
|---|---|---|
| 10 | 55 | 5.5 |
| 100 | 5,050 | 50.5 |
| 1,000 | 500,500 | 500.5 |
| 1,000,000 | 500,000,500,000 | 500,000.5 |
Limits
- Starts at 1; other starts need prefix subtraction.
- Whole n only to one hundred million.
- Exact integers through the cap.
- Squares and cubes need their own formulas.
Common mistakes
- Adding n(n+1) without halving.
- Off by one on inclusive ranges.
- Looping millions instead of using the formula.
- Averaging endpoints of even counts wrongly.
- Trusting floats past exact range.
Try it yourself
Quick checks. Answers sit tucked under each question.
1 to 1000?
1000 x 1001 / 2 = 500,500.
1 to 10?
10 x 11 / 2 = 55.
Sum 50 to 100?
5050 - 1225 = 3,825 (subtract 1 to 49).
Questions
What is 1 to 100 added?
5,050: fifty pairs of 101.
Who found this?
Young Gauss, pairing 1+100 through 50+51.
Why divide by two?
n(n+1) counts every pair twice over.
Other starting points?
Subtract the prefix: 50 to 100 is 5050 minus 1225.
How big can n be?
One hundred million here with exact integers.
Average of 1 to n?
(n+1)/2: the exact middle value.