What this calculator does
Finding consecutive integers with a given sum is a classic algebra problem, and the arithmetic is neater than the usual setup suggests. The average of the run is simply the sum divided by how many numbers there are.
Whether an integer solution exists depends on parity. A sum of 99 splits into three consecutive integers as 32, 33, 34, and into two as 49 and 50, but there is no run of four consecutive integers that totals 99.
The formula
The run is symmetric about its average, so the first term is the average less half the total spread. If that first term is not a whole number, no integer solution exists.
| Term | Meaning |
|---|---|
| Consecutive integers | A run differing by 1 at each step. |
| Consecutive even or odd | A run differing by 2, which the spacing option selects. |
| Parity constraint | Why some counts have no solution for a given sum. |
The inputs explained
| Field | What to enter |
|---|---|
| Target sum | The target sum the numbers must add to. |
| How many numbers | How many numbers are in the run. |
| Spacing | Spacing: 1 for consecutive integers, 2 for consecutive even or odd numbers. |
When to use it
Solving a word problem
The consecutive integer problem is a staple of algebra courses.
Understanding why some cases fail
Not every sum can be split into every number of consecutive terms.
Working with even or odd runs
The spacing option handles runs that skip every other number.
Worked examples
Every figure in the tables below is produced by this page’s own calculator at build time, so the numbers and the tool always agree. Select any row to load that scenario.
Which run lengths work for 99?
The same sum split into four different run lengths.
| How many numbers | Sequence | First number |
|---|---|---|
| 2 numbers | 49, 50 | 49.00 |
| 3 numbers | 32, 33, 34 | 32.00 |
| 4 numbers | No exact integer solution for these inputs | 23.25 |
| 5 numbers | No exact integer solution for these inputs | 17.80 |
Questions
Why do some run lengths have no solution?
Because the average must be achievable. For an odd count the average is the middle number and must itself be a whole number; for an even count it must land exactly halfway between two integers. A sum that satisfies neither has no solution at that length.
Which sums split into consecutive integers at all?
Every positive integer except the powers of two. That result is worth knowing: it means 1, 2, 4, 8, 16 and so on cannot be written as a sum of two or more consecutive positive integers.
Does this work with negative numbers?
Yes. The run can extend below zero, which is how sums smaller than the count are handled. A sum of zero, for instance, splits into −1, 0, 1.
How does even or odd spacing change things?
The run then steps by 2 instead of 1, so the spread doubles for the same count. That shifts which sums are achievable, since the first term must now also match the parity of the run.
For sequence sums in general, see the arithmetic sequence calculator. For divisibility properties, see the divisibility test calculator.