8. let $M \subset\{1,2,3, \ldots, 2007\}$ be a set with the following property: Among every three numbers from $M$ you can always choose two so that one is divisible by the other. What is the maximum number of numbers $M$ can contain?
## 1st solution

Decompose the set $\{1,2,3, \ldots, 2007\}$ into 11 subsets as follows:

$$
\{1\} \cup\{2,3\} \cup\{4,5,6,7\} \cup \ldots \cup\{256, \ldots, 511\} \cup\{512, \ldots, 1023\} \cup\{1024, \ldots, 2007\}
$$

From each of these subsets, $M$ can contain at most two numbers, because the quotient of each two such numbers is between $\frac{1}{2}$ and 2, so it is certainly not whole. Thus, $M$ can contain at most $1+10 \cdot 2=21$ elements. On the other hand, the 21-element set

$$
M=\left\{1,2,4,8, \ldots, 2^{10}\right\} \cup\left\{3,6,12,24, \ldots, 3 \cdot 2^{9}\right\}=A \cup B
$$

is the condition of the task, because two of every three elements are in the same subset $A$ or $B$, the smaller of the two then divides the larger.