How this instrument works
A run of consecutive integers is built the same way every time: pick a starting value and add one, again and again. Algebra students meet this as the classic word problem — three consecutive integers add to some given total, so call the first one x and write the rest as x + 1 and x + 2. Summing all n terms this way gives n·x plus the sum of the offsets 0 through n − 1, which is n(n − 1) ⁄ 2. Solve that single equation for x and the offset term simply moves to the other side, divided by n: first = sum ⁄ n − (n − 1) ⁄ 2.
sum ⁄ n is the plain average of the n integers, and for any evenly spaced run that average sits exactly at the middle of the list — no approximation involved, since the offsets above and below the midpoint cancel in pairs. Subtracting (n − 1) ⁄ 2, half the run's total span, walks back from that middle to the first term. When n is odd the middle is an actual integer in the run; when n is even the 'middle' falls between the two central integers, and the sheet's own half-step keeps the arithmetic honest either way.
Not every total has a matching run: if sum ⁄ n − (n − 1) ⁄ 2 doesn't land on a whole number, no consecutive integers exist for that particular pairing of sum and count. The test is arithmetic, not guesswork — an odd n needs sum divisible by n outright; an even n needs sum ⁄ n to land exactly halfway between two integers, like 3.5. Push the same idea across every possible run length and a genuine curiosity appears: mathematicians call a whole number 'polite' if some run of two or more consecutive positive integers sums to it, and every whole number qualifies except the powers of two — 16 can never be split into consecutive positive integers, whatever length of run is tried.
- Enter the total in Sum of the integers — the number the whole run adds up to.
- Enter the run length in How many consecutive integers — how many numbers in a row you're solving for.
- Read First integer for the smallest whole number in the run.
- Read Last integer for the largest; it always equals First integer plus (How many consecutive integers minus 1).
- A decimal in either result means no run of consecutive integers fits that sum and count — try a different count.
Worked example — 27 split three ways
Three consecutive integers add to 27. Divide first: 27 ⁄ 3 = 9 is the plain average, and because three numbers in a row straddle their own middle term exactly, 9 is also the middle integer itself. Step back (3 − 1) ⁄ 2 = 1 place to reach the first integer: first = 9 − 1 = 8.
The last integer comes from counting the same distance forward: last = first + (n − 1) = 8 + 2 = 10. The full run is 8, 9, 10 — three numbers, each one more than the last — and they do add to 27 exactly (8 + 9 + 10 = 27), matching this sheet's own output for a sum of 27 across 3 integers.
Questions
How is the consecutive-integers formula derived?
Call the first integer x and write the rest as x + 1, x + 2, and so on up to x + (n − 1). Adding all n terms gives n·x plus the sum of the offsets, 0 + 1 + … + (n − 1) = n(n − 1) ⁄ 2. Setting that equal to the total sum and solving for x gives first = sum ⁄ n − (n − 1) ⁄ 2 — the same rearrangement algebra students do by hand for word problems like 'find three consecutive integers that add to 27.'
Why does the formula subtract (n − 1) ⁄ 2 from the average?
sum ⁄ n is the average of the n integers, and because the run is evenly spaced, that average sits exactly at the middle of the list. Half the run's total span is (n − 1) ⁄ 2, so subtracting it steps back from the middle to the first term. Add the same half-span instead of subtracting it and the result lands on the last integer rather than the first.
What does it mean if First integer isn't a whole number?
It means no consecutive integers exist for that sum and count — the sheet still reports the value the algebra produces, but a decimal result signals there's no whole-number run to find. An odd count needs the sum to divide evenly by it; an even count needs sum divided by count to land exactly halfway between two integers, such as 3.5, not on a whole number.
Is this the same as an arithmetic sequence calculator?
It solves a related but reversed problem. An arithmetic sequence calculator starts from a first term and a common difference and computes forward to a chosen term or running sum. This sheet fixes the common difference at 1 implicitly and works backward from a known sum and count to recover the first and last terms — the word-problem direction, not the forward-computation one.
Does the run have to be positive integers?
No — the algebra doesn't require positivity. A small or negative sum simply produces a run that dips below zero; for instance, three consecutive integers summing to −3 are −2, −1, and 0. The formula treats sign the same way it treats any other number, since subtraction and division don't care which side of zero the result lands on.
Can a power of two ever be a sum of consecutive integers?
Not as a sum of two or more consecutive positive integers — 16, 32, and every other power of two are the one family of whole numbers this kind of run can never reach, a fact number theorists describe by calling every other whole number 'polite.' Allow negative integers into the run, though, and the restriction disappears, since negative and positive terms can cancel toward any target sum.