Problem

Source: Swiss Imo Selection 2006

Tags: combinatorics proposed, combinatorics



Let $n$ be natural number. Each of the numbers $\in\{1,2,\ldots ,n\}$ is coloured in black or white. When we choose a number, we flip it's colour and the colour of all the numbers which have at least one common divider with the chosen number. At the beginning all the numbers were coloured white. For which $n$ are all the numbers black after a finite number of changes?