Which Numbers Are Sums of Consecutive Numbers?
Every positive whole number can be written as a sum of two or more consecutive positive whole numbers, with one family of exceptions: the powers of 2 (1, 2, 4, 8, 16, 32, 64 and so on). Everything else works, and the number of different ways is easy to predict.
NRICH, the mathematics enrichment project at the University of Cambridge, publishes this as its Impossible Sums task. Its examples include 9 = 4 + 5 and also 2 + 3 + 4, and 10 = 1 + 2 + 3 + 4. The task asks readers to convince themselves that 8 and 16 cannot be written this way, to prove that powers of 2 never can, and to ask whether every other number can. The rule below answers both questions. The rule was checked by listing every possible run for each number from 1 to 2,000, and the results matched in every case.
1. The rule in plain words
Throughout, "consecutive" means whole numbers that follow one after another, such as 4, 5, 6, 7. Runs must use positive whole numbers and have at least two terms.
- A number can be written as such a run unless it is a power of 2.
- The number of different runs equals the number of odd divisors of the number, minus 1. The "minus 1" removes the trivial run made of the number alone.
Why odd divisors? A run of an odd number of terms is centered on its middle number, so the total is the middle number times the number of terms. A run of an even number of terms has a total that is an odd number times half the number of terms. Either way, each odd divisor of the target gives one way to set up a run, and the divisor 1 gives the one-term run that does not count.
A power of 2 has only one odd divisor, which is 1. That leaves 1 minus 1 = 0 runs, which is why 2, 4, 8, 16 and the rest can never be built this way.
2. A quick test for any number
- Divide out all the factors of 2 and look at what remains. Powers of 2 leave 1 and fail.
- List the odd divisors of the original number.
- Subtract 1. That is the number of runs.
Examples, all confirmed by direct listing:
| Number | Odd divisors | Runs | The runs |
|---|---|---|---|
| 9 | 1, 3, 9 | 2 | 4 + 5, and 2 + 3 + 4 |
| 15 | 1, 3, 5, 15 | 3 | 7 + 8, 4 + 5 + 6, 1 + 2 + 3 + 4 + 5 |
| 30 | 1, 3, 5, 15 | 3 | 9 + 10 + 11, 6 + 7 + 8 + 9, 4 + 5 + 6 + 7 + 8 |
| 64 | 1 | 0 | none |
Notice that 30 has the same number of runs as 15, because doubling a number does not add odd divisors.
3. Puzzle 1: how many ways for 45?
Count the ways to write 45 as a sum of two or more consecutive positive whole numbers.
Answer: 5 ways. The odd divisors of 45 are 1, 3, 5, 9, 15 and 45, which is six, minus 1 gives five. The runs are 22 + 23, 14 + 15 + 16, 7 through 11, 5 through 10, and 1 through 9. A full listing of every starting point confirms there are no others.
4. Puzzle 2: the smallest number with exactly three ways
What is the smallest number that can be written as a run in exactly three different ways?
Answer: 15. Three ways needs four odd divisors. The smallest number with four odd divisors is 15 (1, 3, 5, 15). Numbers below 15 have at most two ways: 9 has two, and the others have one or none. The runs for 15 are shown in the table above. The next numbers with exactly three ways are 21, 27, 30 and 33.
5. Puzzle 3: the longest run for 100
Write 100 as a sum of consecutive positive whole numbers. Which run is the longest?
Answer: 9 + 10 + 11 + 12 + 13 + 14 + 15 + 16, which has 8 terms. The odd divisors of 100 are 1, 5 and 25, so there are exactly two runs. The other is 18 + 19 + 20 + 21 + 22, with 5 terms. Check the long one: the average of the first and last term is 12.5, and 8 terms times 12.5 is 100.
6. Puzzle 4: which numbers cannot be made?
List every number from 1 to 40 that cannot be written as a sum of two or more consecutive positive whole numbers.
Answer: 1, 2, 4, 8, 16 and 32. These are the powers of 2 up to 40. All other numbers from 1 to 40 have at least one run. At the other extreme, an odd prime such as 7 has odd divisors 1 and 7, so it has exactly one run, which is 3 + 4. Every odd number above 1 can be written as two neighbors that add to it, such as 21 = 10 + 11.
7. Why this makes a good warm-up
The pattern is a nice example of a result you can discover by listing small cases, then explain with divisors. NRICH's own Impossible Sums task follows the same path: list 10 to 15 first, notice that 8 and 16 fail, then prove why powers of 2 always fail. For this problem, listing the runs for each number from 1 to 20 shows the gaps at 1, 2, 4, 8 and 16 before any theory appears.
8. Key takeaways
- Every positive whole number except a power of 2 is a sum of two or more consecutive positive whole numbers.
- The number of runs is the number of odd divisors minus 1.
- Doubling a number does not change its odd divisors, so 15 and 30 both have three runs.
- Any odd number above 1 has at least one run: two neighbors.
- Checked by direct listing for every number from 1 to 2,000.
Sources
More on hobbies from other topics
- Dark Adaptation: How Long Your Eyes Need and Why Red Light Helps · Stargazing Start
- Guess Who? Rules and How Many Questions You Need · Board Game Nights
- How to Edit a Photo on Your Phone in Three Steps · Phone Photo Basics