Consecutive integer sum
Find the sum S of all consecutive integers from a through b, including both endpoints.
Consecutive integer sum
Consecutive integer sum · Add every whole number between two endpoints.
Your data stays in this browser.
Result
Enter the values, then select Calculate.
Use the calculator
Find the sum S of all consecutive integers from a through b, including both endpoints.
- First endpoint: A whole number; reversed endpoints are accepted.
- Second endpoint: A whole number; both endpoints are included.
- Calculate: Result — Consecutive integer sum.
- Copy result · Clear
Formula used for this answer:
k = |b − a| + 1
S = k(a + b) ÷ 2
- a = smaller endpoint
- b = larger endpoint
- k = number of included integers
- S = inclusive range sum
Values substituted
First endpoint = 10 · Second endpoint = 6 → Consecutive integer sum = 40
First endpoint = −3 · Second endpoint = 3 → Consecutive integer sum = 0
Precision, signs, and limits
- Enter a whole number within the safe integer range.
- Consecutive-range endpoints must be safe whole numbers. Reversing them does not change which integers are included.
- The display removes unnecessary trailing zeros and uses scientific notation for very large or very small nonzero results. Calculation retains more precision than the display.
- Only the first six terms are previewed. The tool does not infer missing patterns, parse formulas, draw graphs, save history, or calculate infinite series.
- These inputs produce a result outside the supported numeric range. Use smaller values.
Frequently asked questions
First endpoint?
A whole number; reversed endpoints are accepted.
Second endpoint?
A whole number; both endpoints are included.
Are both integers included in a range sum?
Yes. A range from 6 to 10 contains 6, 7, 8, 9, and 10. Entering 10 then 6 gives the same inclusive range.
General formula
k = |b − a| + 1 · S = k(a + b) ÷ 2