Problem

Source: 2019 Belarus Team Selection Test 2.3

Tags: number theory, primitive root, combinatorics



$1019$ stones are placed into two non-empty boxes. Each second Alex chooses a box with an even amount of stones and shifts half of these stones into another box. Prove that for each $k$, $1\le k\le1018$, at some moment there will be a box with exactly $k$ stones. (O. Izhboldin)