Anshu writes numbers as sums of consecutive numbers: 7 = 3 + 4, 10 = 1 + 2 + 3 + 4, 12 = 3 + 4 + 5, and 15 has three ways: 7 + 8, 4 + 5 + 6 and 1 + 2 + 3 + 4 + 5.
Every odd number is a sum of two consecutive numbers: 2n + 1 = n + (n + 1). Can every even number be written this way? Can 0? (Try allowing negative numbers!)
Try it: take 4 consecutive numbers, say 3, 4, 5, 6. Keep 3 first and put + or − in each of the 3 gaps. Each gap has 2 choices, so there are 2 × 2 × 2 = 8 expressions:
| Expression | Value |
|---|---|
| 3 + 4 + 5 + 6 | 18 |
| 3 + 4 + 5 − 6 | 6 |
| 3 + 4 − 5 + 6 | 8 |
| 3 + 4 − 5 − 6 | −4 |
| 3 − 4 + 5 + 6 | 10 |
| 3 − 4 + 5 − 6 | −2 |
| 3 − 4 − 5 + 6 | 0 |
| 3 − 4 − 5 − 6 | −12 |
Every result is even (0 and negative numbers like −4 are even too: they have a factor 2). With 5, 6, 7, 8 you get 5 + 6 − 7 + 8 = 12 and 5 − 6 − 7 − 8 = −16: even again.
Why? Switch one sign in a + b − c − d to get a − b − c − d. The value changes by (a + b − c − d) − (a − b − c − d) = 2b, an even number. Two numbers that differ by an even number have the same parity. Every one of the 8 expressions can be reached by switching signs, so all 8 share one parity. This works for any 4 numbers, not just consecutive ones.
Tap the diagram to enlarge it
- Odd = n + (n + 1)
- 4 numbers, 3 gaps: 8 sign patterns
- Switching a sign changes the value by an even number