Consider a sequence of integers in arithmetical progression: A, A+B, A+2B, A+3B, ... A+NB.
Systematically pick any two adjacent numbers, and randomly replace them by their sum or difference. Keep at this until only one number remains. Is this number odd or even? What's the largest value this number can attain?
The largest value that the number can attain is the sum of all the numbers, or: NA + ½N(N+1)B.
When you sum/subtract two numbers, the parity of the sum/difference is the same, so the parity of the last number equals the parity of the sum of all numbers. If the sum we found above is odd/even, the last number will be odd/even.
Edited on September 13, 2023, 9:42 pm