3. All natural numbers are divided into "good" and "bad" according to the following rules:

a) From any bad number, you can subtract some natural number not exceeding its half so that the resulting difference becomes "good".

b) From a "good" number, you cannot subtract no more than half of it so that it remains "good".

It is known that the number 1 is "good". Find the nearest "good" number to 2015.
Answer: 2047. Solution. Note that good numbers have the form $2^{n}-1$. Indeed, let a number have the form $M=2^{n}+k$, where $k=0,1, \ldots, 2^{n}-2$. Then from such a number, you can subtract $k+1 \leqslant \frac{1}{2}\left(2^{n}+k\right)=\frac{M}{2}$. On the other hand, from a number of the form $N=2^{n}-1$, you need to subtract at least $2^{n-1}$, which exceeds $\frac{N}{2}=2^{n-1}-\frac{1}{2}$. Therefore, the closest to 2015 will be the number $2047=2^{11}-1$