TITLE: Set with a property
QUESTION [8 upvotes]: This was a mock math olympiad problem sent to me by a friend.

Let $P$ be a set of prime numbers. Then, create a set $S$ of positive integers that satisfies the following property:

For every element $p \in P$, $p$ is a factor of at least three elements in $S$.



Prove that for all sets $P$ and $S$, it is possible to divide $S$ into 4 nonempty subsets such that each $p$ is a factor of at least three integers.

I tried to consider the element $a \in P$ that was a factor of the least number of elements in $S$ and see what I could discover, but got nowhere. I also thought that perhaps some sort of algorithm would work too, but I didn't make any progress. Overall, I'm just not quite sure how to even start.

REPLY [2 votes]: Consider a partition $\{S_1,S_2,\ldots,S_k\}$ such that
($\ast$) each $p \in P$ has multiples in at least two different sets $S_i$
for which $k$ is as small as possible. (Note that there exist partitions for which ($\ast$) is true, such as the partition with only singletons, because of (1).) We intend to show that $k \le 3$.
Indeed, suppose that $k \ge 4$. By minimality of $k$, there exists a $p \in P$ that only divides numbers in $S_1$ and $S_2$; otherwise, we could merge $S_1$ and $S_2$ and ($\ast$) would still hold. Similarly, there is a $q \in P$ that only divides numbers in $S_3$ and $S_4$. But now $S$ does not contain a multiple of $pq$, contradicting (2).