Saved

Press the star next to a tool's name to save it.

All my tools

Consecutive Integers Calculator

Use this consecutive integers calculator to add consecutive numbers, find consecutive numbers with a given sum, and see every way to split a number into consecutive numbers.

Restored your last values ·

To add consecutive numbers, enter the first number and how many there are; use a step of 2 for consecutive even or odd numbers. To find the numbers behind a sum, enter the sum and the count. To list every way a number can be split into consecutive positive numbers, enter the number.

Everything is worked out in your browser. Nothing you type is sent anywhere.

–

–

Choose what you want, enter the numbers, then press Calculate.

See full result

A consecutive integers calculator adds consecutive whole numbers, finds the numbers that add up to a given sum, and lists every way to write a number as a sum of consecutive positive integers. It also handles consecutive even or odd numbers with a step of 2. Enter your numbers and press the button. The formulas follow the Wikipedia pages on triangular numbers and polite numbers, and the work is done in your browser.

How to use the consecutive integers calculator

  1. Choose what you want: a sum, the numbers behind a sum, or all the ways to split a number.
  2. Enter the first number and how many numbers, or the sum.
  3. Use a step of 2 for consecutive even or odd numbers.
  4. Press Calculate.

The sum of consecutive integers

For n consecutive integers starting at a, with step 1, the sum is n times a plus n(n − 1)/2. With a step of s, the second term becomes s times n(n − 1)/2. For 2, 3, 4, 5, 6 the sum is 5 × 2 + 10, which is 20, and for the even numbers 2, 4, 6, 8, the sum is 4 × 2 + 2 × 6, which is also 20. The sum also equals the number of terms times the average of the first and last, which the calculator shows. If you start at 0 or at a negative number, the formula still holds: −3 up to 3 adds up to 0.

Triangular numbers

The Wikipedia page on triangular numbers gives the sum of the numbers from 1 to n as n(n + 1)/2. That is the special case where the first number is 1. The sum of 1 to 100 is 100 × 101 / 2, which is 5,050. The calculator labels these as triangular numbers.

Finding the numbers behind a sum

If you know the sum S and the count n, the first number is (S minus s × n(n − 1)/2) divided by n. It must be a whole number. If 4 consecutive integers add up to 14, the first is (14 − 6)/4, which is 2, so they are 2, 3, 4, 5. If the first number is not a whole number, as for a sum of 15 with 4 numbers, then no such numbers exist, and the calculator says so.

Writing a number as a sum of consecutive numbers

The page on polite numbers calls a positive whole number polite if it can be written as a sum of two or more consecutive positive integers. Its examples: 14 is 2 + 3 + 4 + 5; 9 is 2 + 3 + 4 and also 4 + 5; and 15 is 4 + 5 + 6, 1 + 2 + 3 + 4 + 5 and 7 + 8. The calculator finds all of them by testing each possible count of terms. The number of ways equals the number of odd divisors of the number that are greater than 1. The page also says that a representation starting at 1 means the number is triangular.

Impolite numbers

The numbers that cannot be written this way are the powers of two: 1, 2, 4, 8, 16 and so on. They are called impolite. If you enter 16 or 1,024, the calculator reports that no representation exists. Every other whole number above 2 has at least one.

Where these sums are useful

The formulas give a fast way to add runs of numbers, such as page ranges, seat numbers or days. Puzzles ask for three consecutive numbers with a given sum, or which consecutive even numbers multiply to a value. For three consecutive integers with sum 72, the middle number is 24, so they are 23, 24, 25. In the calculator, enter 72, a count of 3, and choose to find the numbers.

A worked example with even numbers

Suppose four consecutive even numbers add up to 340 and you want to find them. Choose the option to find the numbers, enter 340 as the sum, 4 as the count and 2 as the step. The first number is (340 minus 2 times 6) divided by 4, which is 82, so the numbers are 82, 84, 86 and 88. Check the sum: 82 + 84 + 86 + 88 is 340. The same method works for consecutive odd numbers, where the step is also 2 and the first number is odd.

The middle-number shortcut

When the count of consecutive numbers is odd, the sum equals the count times the middle number. For five consecutive integers with sum 85, the middle number is 17, so they are 15, 16, 17, 18, 19. When the count is even, the sum divided by the count is the average of the two middle numbers, which ends in .5 for consecutive integers. Using this shortcut, you can solve many puzzles in your head, and use the calculator to confirm.

Checking an answer

To check a run of consecutive numbers, add the first and the last, multiply by the count and divide by 2. For 82 to 88 in steps of 2, that is (82 + 88) × 4 ÷ 2, which is 340. If the result differs from the sum you were given, one of the inputs is wrong. The calculator uses exactly this check, and also lists the numbers, so you can see them.

Common mistakes

  • Using the wrong step. Consecutive even numbers have a step of 2.
  • Expecting a solution for every sum. The first number must come out whole.
  • Allowing one term. The ways to split a number need at least two.
  • Forgetting negative numbers. The sum formula works with them, but the splitting uses positive ones only.
  • Confusing the count with the last number. The count is how many terms there are.

What next

Use this often? Add Consecutive to your Home screen.

Frequently asked questions

What is a consecutive integers calculator?

A tool that adds runs of consecutive whole numbers and finds runs that add to a given total.

What is the formula for the sum of n consecutive integers?

n × a + n(n − 1)/2, where a is the first. For 2 to 6 it is 5 × 2 + 10 = 20.

How do you find consecutive integers with a given sum?

First = (S − n(n − 1)/2) ÷ n. For S = 14 and n = 4 the first is 2, giving 2, 3, 4, 5.

Which numbers cannot be written as a sum of consecutive positive integers?

The powers of 2: 1, 2, 4, 8, 16 and so on, which are called impolite numbers.

In how many ways can 15 be written as consecutive integers?

Three ways: 7 + 8, 4 + 5 + 6 and 1 + 2 + 3 + 4 + 5.

What went wrong?

We only receive the reason you pick, never what you typed into the tool.

Thanks for your feedback.

More Math Tools