User Rating 0.0
Total Usage 0 times
Quick presets:
🔎 Enter a target value and click Calculate
Is this tool helpful?

Your feedback helps us improve.

About

Finding a set of consecutive integers whose sum equals a given value requires solving a constrained Diophantine equation. The arithmetic series formula S = n2 (2a + n 1) must yield an integer starting value a. Not every target has a solution for every sequence length. A prime number, for instance, can only be expressed as a sum of consecutive integers in exactly two ways. Errors in manual computation commonly arise from off-by-one mistakes in the index bounds or from neglecting that negative starting values are valid.

This calculator solves for all valid sequences of consecutive integers (standard, even, or odd) that produce a target sum. It also supports product mode for small counts. The tool reports every qualifying sequence length from 2 up to the search limit. Approximation is not involved. Results are exact integer arithmetic. Note: product mode is computationally heavier and limited to sequences of 2 - 10 terms to maintain responsiveness.

consecutive integers integer sequences sum of integers arithmetic series math calculator number sequences

Formulas

For n consecutive integers starting at a, the sum is given by the arithmetic series formula:

S = n2 (2a + n 1)

Solving for the starting integer a:

a = S n(n 1)2n

A valid solution exists if and only if a Z (i.e., the result is an integer with no remainder).

For consecutive even integers with step 2, starting at even value a:

S = n a + n(n 1)

Rearranging: a = S n(n 1)n. Valid when a is an even integer. The same formula applies to consecutive odd integers, but a must be odd.

Where: S = target sum, n = number of integers in the sequence, a = first integer of the sequence.

Reference Data

Target SumTypeCount (n)Starting Integer (a)Sequence
15Consecutive511, 2, 3, 4, 5
15Consecutive344, 5, 6
15Consecutive277, 8
15Consecutive600, 1, 2, 3, 4, 5
100Consecutive51818, 19, 20, 21, 22
100Consecutive899, 10, 11, 12, 13, 14, 15, 16
100Consecutive25−8−8, −7, …, 15, 16
50Even566, 8, 10, 12, 14
45Odd31313, 15, 17
45Odd555, 7, 9, 11, 13
45Odd9−3−3, −1, 1, 3, 5, 7, 9, 11, 13
1000Consecutive165555, 56, …, 69, 70
1000Consecutive252828, 29, …, 51, 52
120Product344 × 5 × 6
5040Product711 × 2 × 3 × 4 × 5 × 6 × 7

Frequently Asked Questions

Yes. The formula places no restriction on the sign of the starting integer a. For example, the sum 15 with 6 consecutive integers yields the sequence starting at 0: (0, 1, 2, 3, 4, 5). With 15 terms, the starting value is −4. Negative starting values are mathematically valid and the calculator reports them.
A sum of n 2 consecutive integers equals n(2a + n 1)2. One of n or (2a + n 1) is always odd. Powers of 2 have no odd factor greater than 1, so no factoring into two factors of different parity exists. Thus 1, 2, 4, 8, 16, etc. cannot be expressed as sums of 2 or more consecutive positive integers.
Product mode uses bounded iteration. For a target product P and sequence length n, the calculator tests starting values from −|P| to |P| (clamped at ±10,000). It multiplies n consecutive values and checks for equality. Because multiplication grows rapidly, the search space is manageable for n 10. Products involving zero are detected and handled separately.
When the count is set to "Find all", the calculator tests every sequence length from 2 up to 2 |S| for sum mode. For most practical targets (up to several million), this completes in under 200ms. For product mode with "Find all", it tests lengths 2 through 10 due to computational cost.
Not necessarily. For consecutive even integers, the sum formula is S = n a + n(n 1). Whether a solution exists depends on divisibility, not on the parity of S itself. For example, 3 consecutive even integers summing to 30 start at 8: (8, 10, 12). But 3 consecutive even integers summing to 31 yields a = 8.33…, which is not an even integer, so no solution exists.
The number of representations of S as a sum of consecutive integers is related to the number of odd divisors of S. Highly composite numbers have many odd divisors and thus many representations. For example, 15 has four odd divisors (1, 3, 5, 15) and can be written as a sum of consecutive integers in 3 ways (excluding the trivial single-term case). The calculator finds all of them.