
2. Let $A, B$ be sets of positive integers such that a sum of arbitrary two different numbers from $A$ is in $B$ and a ratio of arbitrary two different numbers from $B$ (greater one to smaller one) is in $A$. Find the maximum number of elements in $A \cup B$.

(Martin Panák)


Solution. Initially we will prove that the set $A$ consists from at most two numbers. Suppose that three numbers $a<b<c$ belongs to the set $A$. Then the numbers $a+b<a+c<b+c$ are in $B$ and therefore the number

$$
\frac{b+c}{a+c}=1+\frac{b-a}{a+c}
$$

have to be in $A$. This is contradiction because $0<b-a<a+c$ and the number is not integer.

If the set $B$ contains four numbers $k<l<m<n$, then the set $A$ will contain three different numbers $n / k, n / l, n / m$. So the set $B$ has at most three elements and $A \cup B$ has at most five elements.

We achieve the number 5 of elements if $A=\{a, b\}, B=\{k, l, m\}$, where $a<b$ and $l / k=m / l=a, m / k=b$. Then $b=a^{2}(a \geqslant 2)$ and $a+a^{2}$ is one of the elements of $B$; the next two elements are either $a^{2}+a^{3}$ and $a^{3}+a^{4}$ or $1+a$ and $a^{2}+a^{3}$. Eg. sets $A=\{2,4\}, B=\{3,6,12\}$ have five elements together.
