Problem of the Week

Problem 4 Solution

\textbf{Congratulations to the following for successfully solving this problem:}
Rayyan Ansari – Goldington Academy
Ivan – St Bede’s Inter-church School

This is a classic example of the invariance principle. The invariance principle in mathematics states that certain properties or quantities remain unchanged under specific transformations or operations. It’s like having something that stays the same no matter what you do to it.

Notice that at each iteration, a+b is replaced with a+b-2. However, as we perform this until there is only a single item left, there are n-1 iterations (with n being the original number of items in the list). At the end, we are essentially adding every element in the list and subtracting -2 \times (n-1) from the total sum since at every iteration we subtract 2. This allows us to simply add all of the elements in the list and subtract 2 \times (n-1).

First, work out the sum between -5 and 0 (6 elements) which is -15. Then for 1 to 504 (504 elements), which is given by \frac{n(n+1)}{2}:

    \[ \frac{504 \times 505}{2} = 127260 \]

    \[ (127260 + (-15)) - (2 \times (6+504-1)) = 126227 \]

The final number is always \boxed{126227}.

Site Search