Consecutive Integers Calculator — Sum, Mean & Sequence
Enter the first integer and the count, and instantly get the sum, mean, range, product and the full sequence — with every integer plotted on a number line.
Sum = k × (2n + k − 1) / 2
Sequence: 1, 2, 3, 4, 5
- 1
Last integer (n + k − 1)
1 + 5 − 1 = 5 - 2
Sum = k × (2n + k − 1) ÷ 2
5 × (2 × 1 + 5 − 1) ÷ 2 = 15Pairs the first and last term, which always add to the same total, then multiplies by the number of pairs.
How does this calculator work?
The sum of k consecutive integers starting at n is k × (2n + k − 1) / 2. Enter the first integer and the count to get the sum, mean (= n + (k−1)/2), range (= k−1), optional product, and the full sequence visualised on a number line.
Formula
How this is calculated
A set of k consecutive integers starting at n is simply n, n+1, n+2, …, n+k−1. Because the sequence is an arithmetic series with common difference 1, its sum has a closed form: Sum = k × (2n + k − 1) / 2. You can derive this by pairing the smallest with the largest (n and n+k−1, both summing to 2n+k−1), pairing the next pair, and so on.
The mean of a symmetric set of consecutive integers equals the middle value, which is n + (k−1)/2. When k is odd this is a whole number (the literal median element); when k is even it is a half-integer halfway between the two middle elements. The range is simply the difference between the last and first term: k−1.
The product is computed by direct multiplication and shown only for small counts (up to 12) with reasonably sized integers, because the product grows factorially and overflows double-precision floating-point for larger sequences. The number line shows all terms side by side, making the consecutive nature of the sequence visually obvious.
Frequently asked questions
For k consecutive integers starting at n, the sum is k × (2n + k − 1) / 2. Equivalently, it is k × (first + last) / 2 — the count times the average of the first and last term, which works for any arithmetic sequence.
Yes. The formula works for any integer n, including negative values and zero. Negative n shifts the sequence to the left on the number line, and some or all terms will be negative.
Rearrange the sum formula: for a known sum S and count k, the first integer is n = (S − k·(k−1)/2) / k. If n is not a whole number, then no k consecutive integers add to that sum.
Also known as
TG we-Calculate Editorial Team. (2026). Consecutive Integers Calculator — Sum, Mean & Sequence [Online calculator]. TG we-Calculate. https://we-calculate.com/calculator/consecutive-integers-calculator
TG we-Calculate Editorial Team. "Consecutive Integers Calculator — Sum, Mean & Sequence." TG we-Calculate. 2026. https://we-calculate.com/calculator/consecutive-integers-calculator.
TG we-Calculate Editorial Team, "Consecutive Integers Calculator — Sum, Mean & Sequence," TG we-Calculate, 2026. [Online]. Available: https://we-calculate.com/calculator/consecutive-integers-calculator
@misc{wecalculate_consecutive_integers_calculator, title = {Consecutive Integers Calculator — Sum, Mean & Sequence}, author = {{TG we-Calculate Editorial Team}}, howpublished = {\url{https://we-calculate.com/calculator/consecutive-integers-calculator}}, year = {2026}, note = {TG we-Calculate} }
Did this calculator help you?
