Problem

Source: Israel National Olympiad 2019 Q4

Tags: algebra, number theory



In the beginning, the number 1 is written on the board 9999 times. We are allowed to perform the following actions: Erase four numbers of the form $x,x,y,y$, and instead write the two numbers $x+y,x-y$. (The order or location of the erased numbers does not matter) Erase the number 0 from the board, if it's there. Is it possible to reach a state where: Only one number remains on the board? At most three numbers remain on the board?