|
Due to a parity issue (50 here is even) we need to adjust username90's solution. In particular, a sequence of consecutive integers of even length has a half-integer in its middle. In this case, let's consider the sequence of 50 consecutive integers 16, 17, ..., 40, 41, ..., 65 where 40.5 is in the middle and the sum is 40.5 * 50 = 2025. Subtracting 2009 we get a supposed erased value of 2025 - 2009 = 16 and this indeed correspond to a valid solution: 16, 17, ..., 65 => 17, ..., 65 We also could've considered the sequence 17, ..., 41, 42, ..., 65, 66 centered at 41.5 and this would've led to an erased value of 41.5 * 50 - 2009 = 66 which is another solution: 17, ..., 65, 66 => 17, ..., 65 |