The integers $1,2, \ldots, 2018$ are written on the board. Then 2017 operations are performed as follows: choose two numbers $a$ and $b$, erase them, and write $a+b+2 a b$ in their place. At the end, only one integer remains on the board.
What are the possible values that its units digit can take?
Since there are 1009 odd numbers between 1 and 2018, we know that the sum of the integers initially written on the board is odd. Furthermore, one of these integers is congruent to $2(\bmod 5)$. An immediate induction then shows that, after each operation, the sum of the integers written on the board remains odd, and one of these integers is congruent to 2 $(\bmod 5)$. Consequently, the last integer written on the board is congruent to $1(\bmod 2)$ and to 2 $(\bmod 5)$, that is, to $7(\bmod 10)$.