Sum of positive integers calculator
The sum of all whole numbers from n₁ to n₂ in one step — Gauss's trick, n₂(n₂+1)/2 − (n₁−1)n₁/2, instead of adding them one by one. From 1 to 100 is the classic 5050; works for any range and any size.
Related tools
All Numbers & arithmetic tools →Enter Starting number n₁, Ending number n₂ and the Sum of positive integers calculator works out Sum, Count of numbers, Average straight away. For instance, with Starting number n₁ = 1 and Ending number n₂ = 100 it returns Sum = 5,050, Count of numbers = 100 and Average = 50.5.
How to use it
- Enter your values: Starting number n₁, Ending number n₂.
- Read the result instantly: Sum, Count of numbers, Average.
Frequently asked questions
How does the Sum of positive integers calculator work?
It takes Starting number n₁ and Ending number n₂ and derives Sum, Count of numbers and Average from them. The calculation is live as you type, so the result updates on every change.
Which values does the calculator ask for?
2 values: Starting number n₁ and Ending number n₂. Nothing else is required — no account, no file upload.
What does a typical calculation look like?
With Starting number n₁ = 1 and Ending number n₂ = 100, the calculator returns Sum = 5,050, Count of numbers = 100 and Average = 50.5. Those figures come from running this exact tool, so you can reproduce them by entering the same values.
How much does the result change with different inputs?
It moves a lot. Using Starting number n₁ = 2 and Ending number n₂ = 200 instead, Sum goes from 5,050 to 20,099 — which is why it is worth testing a few scenarios rather than trusting a single figure.
What does it give for smaller values?
Scaled down to Starting number n₁ = 1 and Ending number n₂ = 50, Sum comes out at 1,275. The relationship is worth checking at both ends before you rely on a single result.
When would I actually use this?
Reading a number written another way: a Roman numeral on a monument, a hexadecimal colour, a binary byte, or a fraction that needs reducing.
What is the most common mistake?
Assuming a decimal fraction survives a change of base. A tenth is exact in decimal and infinitely repeating in binary, which is why 0.1 + 0.2 is not 0.3 in most programming languages.
What is the difference between the Sum of positive integers calculator and the Sum calculator?
This one returns Count of numbers; the Sum calculator returns Count. That is the whole difference — open the one whose figure you need.
Is there a tool for the next step?
Sum of cubes calculator is the closest one after this: Add up cubes fast: the sum of the first n cubes (1³+2³+…+n³, which equals the square of the n-th triangular number), the cubes over a range n₁³…n₂³, or the cubes of your own list of numbers. Exact integer arithmetic, however large.
What else is worth having open alongside it?
Digit sum calculator and Find minimum and maximum — they come up in the same task often enough to be worth a second tab.