Problem

Source: St Petersburg Olympiad 2010, Grade 11, P4

Tags: number theory



Natural number $N$ is given. Let $p_N$ - biggest prime, that $ \leq N$. On every move we replace $N$ by $N-p_N$. We repeat this until we get $0$ or $1$. If we get $1$ then $N$ is called as good, else is bad. For example, $95$ is good because we get $95 \to 6 \to 1$. Prove that among numbers from $1$ to $1000000$ there are between one quarter and half good numbers