Which numbers cannot be a sum of consecutive numbers?
Nine is 4 + 5 and also 2 + 3 + 4. Fifteen is 7 + 8. Ten is 1 + 2 + 3 + 4. But 8 cannot be written as a sum of two or more consecutive positive whole numbers, and neither can 16.
Which positive whole numbers cannot be written as a sum of two or more consecutive positive whole numbers? Prove your characterisation in both directions.
Show a hint
A sum of k consecutive numbers starting at a is k times the average, and the average is either a whole number (k odd) or a half-integer (k even). In both cases the sum has an odd factor bigger than 1.
Your answer
Solving needs a free account
Answers, streaks and solutions unlock when you are signed in. Reading the question and the hint stays free.
Discussion
Sign in to join the discussion · reading is open to everyone
💡 Discussion rules
- No full solutions here. Hints and approaches only.
- Complexity, edge cases and intuition are the point.
- Interview experiences are welcome. Respect your NDAs.
Loading discussion…
Learn the concepts
The theory behind this question.
Related questions
Why the sum of the first n cubes is always a perfect squareWriting 100 as a sum of consecutive numbersHow many digits does 2 to the 1000 have?The person whose age is the square root of the yearTwo opposite points with the same temperature
All questions →