Example 1 — Parity invariant
Show the steps and the answer
Count the odd numbers at the start: 1, 3, 5 and 7, so 4 of them.
To see what is preserved, begin with the opening state.
Check each kind of move: odd + odd is even, removing 2 odds; odd + even is odd, keeping the count; even + even is even, keeping it.
Every move changes the odd count by 0 or 2, so whether that count is even never changes.
Conclude: the odd count stays even, so with one number left it must be 0.
A single number gives an odd count of 0 or 1, and only 0 is even, so the last number is even.
Confirm with a second invariant: each move replaces and with , so the sum stays .
The last number equals that sum, 28, which is even, agreeing with the parity argument.
Answer: The number of odd entries always stays even (its parity is invariant), so the final number is even; the sum is also invariant, so the final number is 28.
Takeaway: Check how every kind of move affects a quantity; if it only changes by even amounts, its parity is an invariant that fixes the ending.