Last verified · v1.0
Calculator · math
Consecutive Integers Calculator
Find consecutive integers that add up to a target sum. Supports standard, even, and odd integer sequences with instant results.
Inputs
First Integer in Sequence
—
Explain my result
Get a plain-English breakdown of your result with practical next steps.
The formula
How the
result is
computed.
How the Consecutive Integers Calculator Works
The consecutive integers calculator applies a single algebraic formula to find any sequence of back-to-back integers — standard, even, or odd — that adds up to a specified target sum. This tool handles classic algebra word problems, number theory explorations, and math competition preparation with equal precision.
The Core Formula
The first integer x in the sequence is determined by:
x = (S − k ⋅ N(N − 1) / 2) / N
Each variable plays a distinct role:
- S — the target sum that all integers in the sequence must total
- N — the count of consecutive integers in the sequence
- k — the step size: 1 for consecutive integers, 2 for consecutive even or consecutive odd integers
- x — the first (and smallest) integer in the resulting sequence
Once x is calculated, every subsequent term follows as x + k, x + 2k, and so on through x + (N − 1)k.
Formula Derivation
Consider N consecutive integers beginning at x with uniform step k. The i-th term (starting at i = 0) equals x + ik. Summing all N terms produces:
S = Nx + k(0 + 1 + 2 + … + (N − 1)) = Nx + k ⋅ N(N − 1) / 2
Subtracting k ⋅ N(N − 1) / 2 from both sides and then dividing by N isolates x in one step. This algebraic manipulation follows the principles of linear equation solving documented in Khan Academy's lesson on sums of consecutive integers and is reinforced in the West Texas A&M University tutorial on the Multiplication Property of Equality.
Choosing the Right Step Size k
- k = 1 — Consecutive Integers: Terms increase by 1. Example sequence: 11, 12, 13, 14.
- k = 2 — Consecutive Even Integers: Terms increase by 2 and every term is even. Example: 6, 8, 10, 12.
- k = 2 — Consecutive Odd Integers: Terms increase by 2 and every term is odd. Example: 7, 9, 11, 13.
Worked Examples
Example 1: Three Consecutive Integers Summing to 24
Inputs: S = 24, N = 3, k = 1
x = (24 − 1 ⋅ 3 ⋅ 2 / 2) / 3 = (24 − 3) / 3 = 21 / 3 = 7
Sequence: 7, 8, 9 → 7 + 8 + 9 = 24 ✓
Example 2: Four Consecutive Even Integers Summing to 36
Inputs: S = 36, N = 4, k = 2
x = (36 − 2 ⋅ 4 ⋅ 3 / 2) / 4 = (36 − 12) / 4 = 24 / 4 = 6
Sequence: 6, 8, 10, 12 → 6 + 8 + 10 + 12 = 36 ✓
Example 3: Five Consecutive Odd Integers Summing to 55
Inputs: S = 55, N = 5, k = 2
x = (55 − 2 ⋅ 5 ⋅ 4 / 2) / 5 = (55 − 20) / 5 = 35 / 5 = 7
Sequence: 7, 9, 11, 13, 15 → 7 + 9 + 11 + 13 + 15 = 55 ✓
Validity Conditions
A valid solution requires x to be a whole number. If the formula returns a decimal, no sequence of the chosen type satisfies the given inputs. For even sequences, x must also be even; for odd sequences, x must be odd. Adjusting N or the integer type typically resolves invalid results.
Handling Edge Cases and Optimization
Sometimes initial inputs produce non-integer results or sequences where the first term fails to match parity requirements — even values for even sequences, odd values for odd sequences. When this occurs, several troubleshooting strategies improve outcomes. First, verify that your target sum S and sequence length N are compatible with the step size k. For consecutive even or odd integers, the sum S must have the same parity as N times k. Second, incrementally adjust the count N to nearby values — trying N+1 or N−1 often yields valid solutions. Third, consider whether switching between consecutive, even, and odd modes aligns better with your problem constraints. The calculator's ability to test multiple configurations rapidly makes it an invaluable tool for exploratory number analysis and educational verification of algebraic reasoning.
Real-World Applications
- Algebra Education: Solving standard word problems about consecutive number sequences at the middle- and high-school level.
- Math Competitions: Rapidly verifying integer-sum problems under time constraints.
- Puzzle Construction: Designing number puzzles with prescribed sums and sequence lengths.
- Number Theory: Investigating arithmetic progressions and properties of integer partitions.
Reference