File size: 25,948 Bytes
4f3431c | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 | # Baltic Way 2003
Riga, November 2, 2003
## Problems and solutions
1. Let $\mathbb{Q}_{+}$be the set of positive rational numbers. Find all functions $f: \mathbb{Q}_{+} \rightarrow \mathbb{Q}_{+}$which for all $x \in \mathbb{Q}_{+}$fulfil
(1) $f\left(\frac{1}{x}\right)=f(x)$
(2) $\left(1+\frac{1}{x}\right) f(x)=f(x+1)$
Solution: Set $g(x)=\frac{f(x)}{f(1)}$. Function $g$ fulfils (1), (2) and $g(1)=1$. First we prove that if $g$ exists then it is unique. We prove that $g$ is uniquely defined on $x=\frac{p}{q}$ by induction on $\max (p, q)$. If $\max (p, q)=1$ then $x=1$ and $g(1)=1$. If $p=q$ then $x=1$ and $g(x)$ is unique. If $p \neq q$ then we can assume (according to (1)) that $p>q$. From (2) we get $g\left(\frac{p}{q}\right)=\left(1+\frac{q}{p-q}\right) g\left(\frac{p-q}{q}\right)$. The induction assumption and $\max (p, q)>\max (p-q, q) \geq 1$ now give that $g\left(\frac{p}{q}\right)$ is unique.
Define the function $g$ by $g\left(\frac{p}{q}\right)=p q$ where $p$ and $q$ are chosen such that $\operatorname{gcd}(p, q)=1$. It is easily seen that $g$ fulfils (1), (2) and $g(1)=1$. All functions fulfilling (1) and (2) are therefore $f\left(\frac{p}{q}\right)=a p q$, where $\operatorname{gcd}(p, q)=1$ and $a \in \mathbb{Q}_{+}$.
2. Prove that any real solution of
$$
x^{3}+p x+q=0
$$
satisfies the inequality $4 q x \leq p^{2}$.
Solution: Let $x_{0}$ be a root of the qubic, then $x^{3}+p x+q=\left(x-x_{0}\right)\left(x^{2}+a x+b\right)=$ $x^{3}+\left(a-x_{0}\right) x^{2}+\left(b-a x_{0}\right) x-b x_{0}$. So $a=x_{0}, p=b-a x_{0}=b-x_{0}^{2},-q=b x_{0}$. Hence $p^{2}=b^{2}-2 b x_{0}^{2}+x_{0}^{4}$. Also $4 x_{0} q=-4 x_{0}^{2} b$. So $p^{2}-4 x_{0} q=b^{2}+2 b x_{0}^{2}+x_{0}^{4}=\left(b+x_{0}^{2}\right)^{2} \geq 0$.
Solution 2: As the equation $x_{0} x^{2}+p x+q=0$ has a root $\left(x=x_{0}\right)$, we must have $D \geq 0 \Leftrightarrow p^{2}-4 q x_{0} \geq 0$. (Also the equation $x^{2}+p x+q x_{0}=0$ having the root $x=x_{0}^{2}$ can be considered.)
3. Let $x, y$ and $z$ be positive real numbers such that $x y z=1$. Prove that
$$
(1+x)(1+y)(1+z) \geq 2\left(1+\sqrt[3]{\frac{y}{x}}+\sqrt[3]{\frac{z}{y}}+\sqrt[3]{\frac{x}{z}}\right)
$$
Solution: Put $a=b x, b=c y$ and $c=a z$. The given inequality then takes the form
$$
\begin{aligned}
\left(1+\frac{a}{b}\right)\left(1+\frac{b}{c}\right)\left(1+\frac{c}{a}\right) & \geq 2\left(1+\sqrt[3]{\frac{b^{2}}{a c}}+\sqrt[3]{\frac{c^{2}}{a b}}+\sqrt[3]{\frac{a^{2}}{b c}}\right) \\
& =2\left(1+\frac{a+b+c}{3 \sqrt[3]{a b c}}\right) .
\end{aligned}
$$
By the AM-GM inequality we have
$$
\begin{aligned}
\left(1+\frac{a}{b}\right)\left(1+\frac{b}{c}\right)\left(1+\frac{c}{a}\right) & =\frac{a+b+c}{a}+\frac{a+b+c}{b}+\frac{a+b+c}{c}-1 \\
& \geq 3\left(\frac{a+b+c}{\sqrt[3]{a b c}}\right)-1 \geq 2 \frac{a+b+c}{\sqrt[3]{a b c}}+3-1=2\left(1+\frac{a+b+c}{\sqrt[3]{a b c}}\right) .
\end{aligned}
$$
Solution 2: Expanding the left side we obtain
$$
x+y+z+\frac{1}{x}+\frac{1}{y}+\frac{1}{z} \geq 2\left(\sqrt[3]{\frac{y}{x}}+\sqrt[3]{\frac{z}{y}}+\sqrt[3]{\frac{x}{z}}\right)
$$
As $\sqrt[3]{\frac{y}{x}} \leq \frac{1}{3}\left(y+\frac{1}{x}+1\right)$ etc., it suffices to prove that
$$
x+y+z+\frac{1}{x}+\frac{1}{y}+\frac{1}{z} \geq \frac{2}{3}\left(x+y+z+\frac{1}{x}+\frac{1}{y}+\frac{1}{z}\right)+2
$$
which follows from $a+\frac{1}{a} \geq 2$.
4. Let $a, b, c$ be positive real numbers. Prove that
$$
\frac{2 a}{a^{2}+b c}+\frac{2 b}{b^{2}+c a}+\frac{2 c}{c^{2}+a b} \leq \frac{a}{b c}+\frac{b}{c a}+\frac{c}{a b} .
$$
Solution: First we prove that
$$
\frac{2 a}{a^{2}+b c} \leq \frac{1}{2}\left(\frac{1}{b}+\frac{1}{c}\right)
$$
which is equivalent to $0 \leq b(a-c)^{2}+c(a-b)^{2}$, and therefore holds true. Now we turn to the inequality
$$
\frac{1}{b}+\frac{1}{c} \leq \frac{1}{2}\left(\frac{2 a}{b c}+\frac{b}{c a}+\frac{c}{a b}\right),
$$
which by multiplying by $2 a b c$ is seen to be equivalent to $0 \leq(a-b)^{2}+(a-c)^{2}$. Hence we have proved that
Analogously we have
$$
\frac{2 a}{a^{2}+b c} \leq \frac{1}{4}\left(\frac{2 a}{b c}+\frac{b}{c a}+\frac{c}{a b}\right) .
$$
$$
\begin{aligned}
\frac{2 b}{b^{2}+c a} & \leq \frac{1}{4}\left(\frac{2 b}{c a}+\frac{c}{a b}+\frac{a}{b c}\right) \\
\frac{2 c}{c^{2}+a b} & \leq \frac{1}{4}\left(\frac{2 c}{a b}+\frac{a}{b c}+\frac{b}{c a}\right)
\end{aligned}
$$
and it suffices to sum the above three inequalities.
Solution 2: As $a^{2}+b c \geq 2 a \sqrt{b c}$ etc., it is sufficient to prove that
$$
\frac{1}{\sqrt{b c}}+\frac{1}{\sqrt{a c}}+\frac{1}{\sqrt{a b}} \leq \frac{a}{b c}+\frac{b}{c a}+\frac{c}{a b}
$$
which can be obtained by "inserting" $\frac{1}{a}+\frac{1}{b}+\frac{1}{c}$ between the left side and the right side.
5. A sequence $\left(a_{n}\right)$ is defined as follows: $a_{1}=\sqrt{2}, a_{2}=2$, and $a_{n+1}=a_{n} a_{n-1}^{2}$ for $n \geq 2$. Prove that for every $n \geq 1$ we have
$$
\left(1+a_{1}\right)\left(1+a_{2}\right) \cdots\left(1+a_{n}\right)<(2+\sqrt{2}) a_{1} a_{2} \cdots a_{n} .
$$
Solution: First we prove inductively that for $n \geq 1, a_{n}=2^{2^{n-2}}$. We have $a_{1}=2^{2^{-1}}$, $a_{2}=2^{2^{0}}$ and
$$
a_{n+1}=2^{2^{n-2}} \cdot\left(2^{2^{n-3}}\right)^{2}=2^{2^{n-2}} \cdot 2^{2^{n-2}}=2^{2^{n-1}} .
$$
Since $1+a_{1}=1+\sqrt{2}$, we must prove, that
$$
\left(1+a_{2}\right)\left(1+a_{3}\right) \cdots\left(1+a_{n}\right)<2 a_{2} a_{3} \cdots a_{n} .
$$
The right-hand side is equal to
$$
2^{1+2^{0}+2^{1}+\cdots+2^{n-2}}=2^{2^{n-1}}
$$
and the left-hand side
$$
\begin{aligned}
\left(1+2^{2^{0}}\right) & \left(1+2^{2^{1}}\right) \cdots\left(1+2^{2^{n-2}}\right) \\
& =1+2^{2^{0}}+2^{2^{1}}+2^{2^{0}+2^{1}}+2^{2^{2}}+\cdots+2^{2^{0}+2^{1}+\cdots+2^{n-2}} \\
& =1+2+2^{2}+2^{3}+\cdots+2^{2^{n-1}-1} \\
& =2^{2^{n-1}}-1 .
\end{aligned}
$$
The proof is complete.
6. Let $n \geq 2$ and $d \geq 1$ be integers with $d \mid n$, and let $x_{1}, x_{2}, \ldots, x_{n}$ be real numbers such that $x_{1}+x_{2}+\cdots+x_{n}=0$. Prove that there are at least $\left(\begin{array}{l}n-1 \\ d-1\end{array}\right)$ choices of $d$ indices $1 \leq i_{1}<i_{2}<\cdots<i_{d} \leq n$ such that $x_{i_{1}}+x_{i_{2}}+\cdots+x_{i_{d}} \geq 0$.
Solution: Put $m=n / d$ and $[n]=\{1,2, \ldots, n\}$, and consider all partitions $[n]=A_{1} \cup$ $A_{2} \cup \cdots \cup A_{m}$ of $[n]$ into $d$-element subsets $A_{i}, i=1,2, \ldots, m$. The number of such partitions is denoted by $t$. Clearly, there are exactly $\left(\begin{array}{l}n \\ d\end{array}\right) d$-element subsets of $[n]$ each of which occurs in the same number of partitions. Hence, every $A \subseteq[n]$ with $|A|=d$ occurs in exactly $s:=t m /\left(\begin{array}{l}n \\ d\end{array}\right)$ partitions. On the other hand, every partition contains at least one $d$-element set $A$ such that $\sum_{i \in A} x_{i} \geq 0$. Consequently, the total number of sets with this property is at least $t / s=\left(\begin{array}{l}n \\ d\end{array}\right) / m=\frac{d}{n}\left(\begin{array}{l}n \\ d\end{array}\right)=\left(\begin{array}{l}n-1 \\ d-1\end{array}\right)$.
7. Let $X$ be a subset of $\{1,2,3, \ldots, 10000\}$ with the following property: If $a, b \in X, a \neq b$, then $a \cdot b \notin X$. What is the maximal number of elements in $X$ ?
Answer: 9901.
Solution: If $X=\{100,101,102, \ldots, 9999,10000\}$, then for any two selected $a$ and $b, a \neq b$, $a \cdot b \geq 100 \cdot 101>10000$, so $a \cdot b \notin X$. So $X$ may have 9901 elements.
Suppose that $x_{1}<x_{2}<\cdots<x_{k}$ are all elements of $X$ that are less than 100. If there are none of them, no more than 9901 numbers can be in the set $X$. Otherwise, if $x_{1}=1$ no other number can be in the set $X$, so suppose $x_{1}>1$ and consider the pairs
$$
\begin{gathered}
200-x_{1},\left(200-x_{1}\right) \cdot x_{1} \\
200-x_{2},\left(200-x_{2}\right) \cdot x_{2} \\
\vdots \\
200-x_{k},\left(200-x_{k}\right) \cdot x_{k}
\end{gathered}
$$
Clearly $x_{1}<x_{2}<\cdots<x_{k}<100<200-x_{k}<200-x_{k-1}<\cdots<200-x_{2}<$ $200-x_{1}<200<\left(200-x_{1}\right) \cdot x_{1}<\left(200-x_{2}\right) \cdot x_{2}<\cdots<\left(200-x_{k}\right) \cdot x_{k}$. So all numbers in these pairs are different and greater than 100. So at most one from each pair is in the set $X$. Therefore, there are at least $k$ numbers greater than 100 and $99-k$ numbers less than 100 that are not in the set $X$, together at least 99 numbers out of 10000 not being in the set $X$.
8. There are 2003 pieces of candy on a table. Two players alternately make moves. A move consists of eating one candy or half of the candies on the table (the "lesser half" if there is an odd number of candies); at least one candy must be eaten at each move. The loser is the one who eats the last candy. Which player - the first or the second - has a winning strategy?
Answer: The second.
Solution: Let us prove inductively that for $2 n$ pieces of candy the first player has a winning strategy. For $n=1$ it is obvious. Suppose it is true for $2 n$ pieces, and let's consider $2 n+2$ pieces. If for $2 n+1$ pieces the second is the winner, then the first eats 1 piece and becomes the second in the game starting with $2 n+1$ pieces. So suppose that for $2 n+1$ pieces the first is the winner. His winning move for $2 n+1$ is not eating 1 piece (according to the inductive assumption). So his winning move is to eat $n$ pieces, leaving the second with $n+1$ pieces, when the second must lose. But the first can leave the second with $n+1$ pieces from the starting position with $2 n+2$ pieces, eating $n+1$ pieces; so $2 n+2$ is a winning position for the first.
Now if there are 2003 pieces of candy on the table, the first must eat either 1 or 1001 candies, leaving an even number of candies on the table. So the second player will be the first player in a game with even number of candies and therefore has a winning strategy.
In general, if there is an odd number $N$ of candies, write $N=2^{m} r+1$, where $r$ is odd. Then the first player wins if $m$ is even, and the second player wins if $m$ is odd: At each move, the player must avoid leaving the other with an even number of candies, so he must eat half of the candies. But this means that the number of candies descend as $2^{m} r+1,2^{m-1} r+1, \ldots, 2 r+1, r+1$, and eventually there is an even number of candies.
9. It is known that $n$ is a positive integer, $n \leq 144$. Ten questions of type "Is $n$ smaller than a?" are allowed. Answers are given with a delay: The answer to the $i$ 'th question is given only after the $(i+1)$ 'st question is asked, $i=1,2, \ldots, 9$. The answer to the tenth question is given immediately after it is asked. Find a strategy for identifying $n$.
Solution: Let the Fibonacci numbers be denoted $F_{0}=1, F_{1}=2, F_{2}=3$ etc. Then $F_{10}=144$. We will prove by induction on $k$ that using $k$ questions subject to the conditions of the problem, it is possible to determine any positive integer $n \leq F_{k}$. First, for $k=0$ it is trivial, since without asking we know that $n=1$. For $k=1$, we simply ask if $n$ is smaller than 2. For $k=2$, we ask if $n$ is smaller than 3 and if $n$ is smaller than 2; from the two answers we can determine $n$.
Now, in general, our first two questions will always be "Is $n$ smaller than $F_{k-1}+1$ ?" and "Is $n$ smaller than $F_{k-2}+1$ ". We then receive the answer to the first question. As long as we receive affirmative answers to the $i-1$ 'st question, the $i+1$ 'st question will be "Is $n$ smaller than $F_{k-(i+1)}+1$ ?". If at any point, say after asking the $j$ 'th question, we receive a negative answer to the $j-1$ 'st question, we then know that $F_{k-(j-1)}+1 \leq n \leq F_{k-(j-2)}$, so $n$ is one of $F_{k-(j-2)}-F_{k-(j-1)}=F_{k-j}$ consecutive integers, and by induction we may determine $n$ using the remaining $k-j$ questions. Otherwise, we receive affirmative answers to all the questions, the last being "Is $n$ smaller than $F_{k-k}+1=2$ ?"; so $n=1$ in that case.
10. A lattice point in the plane is a point whose coordinates are both integral. The centroid of four points $\left(x_{i}, y_{i}\right), i=1,2,3,4$, is the point $\left(\frac{x_{1}+x_{2}+x_{3}+x_{4}}{4}, \frac{y_{1}+y_{2}+y_{3}+y_{4}}{4}\right)$. Let $n$ be the largest natural number with the following property: There are $n$ distinct lattice points in the plane such that the centroid of any four of them is not a lattice point. Prove that $n=12$.
Solution: To prove $n \geq 12$, we have to show that there are 12 lattice points $\left(x_{i}, y_{i}\right)$, $i=1,2, \ldots, 12$, such that no four determine a lattice point centroid. This is guaranteed if we just choose the points such that $x_{i} \equiv 0(\bmod 4)$ for $i=1, \ldots, 6, x_{i} \equiv 1(\bmod 4)$ for
$i=7, \ldots, 12, y_{i} \equiv 0(\bmod 4)$ for $i=1,2,3,10,11,12, y_{i} \equiv 1(\bmod 4)$ for $i=4, \ldots, 9$.
Now let $P_{i}, i=1,2, \ldots, 13$, be lattice points. We have to show that some four of them determine a lattice point centroid. First observe that, by the Pigeonhole Principle, among any five of the points we find two such that their $x$-coordinates as well as their $y$-coordinates have the same parity. Consequently, among any five of the points there are two whose midpoint is a lattice point. Iterated application of this observation implies that among the 13 points in question we find five disjoint pairs of points whose midpoint is a lattice point. Among these five midpoints we again find two, say $M$ and $M^{\prime}$, such that their midpoint $C$ is a lattice point. Finally, if $M$ and $M^{\prime}$ are the midpoints of $P_{i} P_{j}$ and $P_{k} P_{\ell}$, respectively, $\{i, j, k, \ell\} \subseteq\{1,2, \ldots, 13\}$, then $C$ is the centroid of $P_{i}, P_{j}, P_{k}, P_{\ell}$.
11. Is it possible to select 1000 points in a plane so that at least 6000 distances between two of them are equal?
Answer: Yes.
Solution: Let's start with configuration of 4 points and 5 distances equal to $d$, like in this figure:
$(\alpha)$

Now take $(\alpha)$ and two copies of it obtainable by parallel shifts along vectors $\vec{a}$ and $\vec{b},|\vec{a}|=|\vec{b}|=d$ and $\angle(\vec{a}, \vec{b})=60^{\circ}$. Vectors $\vec{a}$ and $\vec{b}$ should be chosen so that no two vertices of $(\alpha)$ and of the two copies coincide. We get $3 \cdot 4=12$ points and $3 \cdot 5+12=27$ distances. Proceeding in the same way, we get gradually
- $3 \cdot 12=36$ points and $3 \cdot 27+36=117$ distances;
- $3 \cdot 36=108$ points and $3 \cdot 117+108=459$ distances;
- $3 \cdot 108=324$ points and $3 \cdot 459+324=1701$ distances;
- $3 \cdot 324=972$ points and $3 \cdot 1701+972=6075$ distances.
12. Let $A B C D$ be a square. Let $M$ be an inner point on side $B C$ and $N$ be an inner point on side $C D$ with $\angle M A N=45^{\circ}$. Prove that the circumcentre of $A M N$ lies on $A C$.
Solution: Draw a circle $\omega$ through $M, C, N$; let it intersect $A C$ at $O$. We claim that $O$ is the circumcentre of $A M N$.
Clearly $\angle M O N=180^{\circ}-\angle M C N=90^{\circ}$. If the radius of $\omega$ is $R$, then $O M=$ $2 R \sin 45^{\circ}=R \sqrt{2}$; similarly $O N=R \sqrt{2}$. Hence we get that $O M=O N$. Then the circle with centre $O$ and radius $R \sqrt{2}$ will pass through $A$, since $\angle M A N=\frac{1}{2} \angle M O N$.

13. Let $A B C D$ be a rectangle and $B C=2 \cdot A B$. Let $E$ be the midpoint of $B C$ and $P$ an arbitrary inner point of $A D$. Let $F$ and $G$ be the feet of perpendiculars drawn correspondingly from $A$ to $B P$ and from $D$ to $C P$. Prove that the points $E, F, P, G$ are concyclic.
Solution: From rectangular triangle $B A P$ we have $B P \cdot B F=A B^{2}=B E^{2}$. Therefore the circumference through $F$ and $P$ touching the line $B C$ between $B$ and $C$ touches it at $E$.
Analogously, the circumference through $P$ and $G$ touching the line $B C$ between $B$ and $C$ touches it at $E$. But there is only one circumference touching $B C$ at $E$ and passing through $P$.

14. Let $A B C$ be an arbitrary triangle and $A M B, B N C, C K A$ regular triangles outward of $A B C$. Through the midpoint of $M N$ a perpendicular to $A C$ is constructed; similarly through the midpoints of $N K$ resp. KM perpendiculars to $A B$ resp. $B C$ are constructed. Prove that these three perpendiculars intersect at the same point.
Solution: Let $O$ be the midpoint of $M N$, and let $E$ and $F$ be the midpoints of $A B$ and $B C$, respectively. As triangle $M B C$ transforms into triangle $A B N$ when rotated $60^{\circ}$ around $B$ we get $M C=A N$ (it is also a well-known fact). Considering now the quadrangles $A M B N$ and $C M B N$ we get $O E=O F$ (from Eiler's formula $a^{2}+b^{2}+c^{2}+d^{2}=e^{2}+f^{2}+4 \cdot P Q^{2}$ or otherwise). As $E F \| A C$ we get from this that the perpendicular to $A C$ through $O$ passes through the circumcentre of $E F G$, as it is the perpendicular bisector of $E F$. The same holds for the other two perpendiculars.

First solution

Second solution
Solution 2: Let us denote the midpoints of the segments $M N, N K, K M$ by $B_{1}, C_{1}, A_{1}$, respectively. It is easy to see that triangle $A_{1} B_{1} C_{1}$ is homothetic to triangle $N K M$ via the homothety centered at the intersection of the medians of triangle $N M K$ and dilation $-\frac{1}{2}$. The perpendiculars through $M, N, K$ to $A B, B C, C A$, respectively, are also the perpendicular bisectors of these sides, so they intersect in the circumcentre of triangle $A B C$. The desired result follows now from the homothety, and we find that that the common point of intersection is the circumcentre of the image of triangle $A B C$ under the homothety; that is, the circumcentre of the triangle with vertices the midpoints of the sides $A B, B C, C A$.
15. Let $P$ be the intersection point of the diagonals $A C$ and $B D$ in a cyclic quadrilateral. $A$ circle through $P$ touches the side $C D$ in the midpoint $M$ of this side and intersects the segments $B D$ and $A C$ in the points $Q$ and $R$, respectively. Let $S$ be a point on the segment $B D$ such that $B S=D Q$. The parallel to $A B$ through $S$ intersects $A C$ at $T$. Prove that $A T=R C$.
Solution: With reference to the figure below we have $C R \cdot C P=D Q \cdot D P=C M^{2}=D M^{2}$, which is equivalent to $R C=\frac{D Q \cdot D P}{C P}$. We also have $\frac{A T}{B S}=\frac{A P}{B P}=\frac{A T}{D Q}$, so $A T=\frac{A P \cdot D Q}{B P}$. Since $A B C D$ is cyclic the result now comes from the fact that $D P \cdot B P=A P \cdot C P$ (due to a well-known theorem).

16. Find all pairs of positive integers $(a, b)$ such that $a-b$ is a prime and $a b$ is a perfect square. Answer: Pairs $(a, b)=\left(\left(\frac{p+1}{2}\right)^{2},\left(\frac{p-1}{2}\right)^{2}\right)$, where $p$ is a prime greater than 2 .
Solution: Let $p$ be a prime such that $a-b=p$ and let $a b=k^{2}$. Insert $a=b+p$ in the equation $a b=k^{2}$. Then
$$
k^{2}=(b+p) b=\left(b+\frac{p}{2}\right)^{2}-\frac{p^{2}}{4}
$$
which is equivalent to
$$
p^{2}=(2 b+p)^{2}-4 k^{2}=(2 b+p+2 k)(2 b+p-2 k) .
$$
Since $2 b+p+2 k>2 b+p-2 k$ and $p$ is a prime, we conclude $2 b+p+2 k=p^{2}$ and $2 b+p-2 k=1$. By adding these equations we get $2 b+p=\frac{p^{2}+1}{2}$ and then $b=\left(\frac{p-1}{2}\right)^{2}$, so $a=b+p=\left(\frac{p+1}{2}\right)^{2}$. By checking we conclude that all the solutions are $(a, b)=\left(\left(\frac{p+1}{2}\right)^{2},\left(\frac{p-1}{2}\right)^{2}\right)$ with $p$ a prime greater than 2 .
Solution 2: Let $p$ be a prime such that $a-b=p$ and let $a b=k^{2}$. We have $(b+p) b=k^{2}$, so $\operatorname{gcd}(b, b+p)=\operatorname{gcd}(b, p)$ is equal either to 1 or $p$. If $\operatorname{gcd}(b, b+p)=p$, let $b=b_{1} p$. Then $p^{2} b_{1}\left(b_{1}+1\right)=k^{2}, b_{1}\left(b_{1}+1\right)=m^{2}$, but this equation has no solutions.
Hence $\operatorname{gcd}(b, b+p)=1$, and
$$
b=u^{2} \quad b+p=v^{2}
$$
so that $p=v^{2}-u^{2}=(v+u)(v-u)$. This in turn implies that $v-u=1$ and $v+u=p$, from which we finally obtain $a=\left(\frac{p+1}{2}\right)^{2}, b=\left(\frac{p-1}{2}\right)^{2}$, where $p$ must be an odd prime.
17. All the positive divisors of a positive integer $n$ are stored into an array in increasing order. Mary has to write a program which decides for an arbitrarily chosen divisor $d>1$ whether it is a prime. Let $n$ have $k$ divisors not greater than $d$. Mary claims that it suffices to check divisibility of $d$ by the first $\lceil k / 2\rceil$ divisors of $n$ : If a divisor of $d$ greater than 1 is found among them, then $d$ is composite, otherwise d is prime. Is Mary right?
Answer: Yes, Mary is right.
Solution: Let $d>1$ be a divisor of $n$. Suppose Mary's program outputs "composite" for $d$. That means it has found a divisor of $d$ greater than 1 . Since $d>1$, the array contains at least 2 divisors of $d$, namely 1 and $d$. Thus Mary's program does not check divisibility of $d$ by $d$ (the first half gets complete before reaching $d$ ) which means that the divisor found lays strictly between 1 and $d$. Hence $d$ is composite indeed.
Suppose now $d$ being composite. Let $p$ be its smallest prime divisor; then $\frac{d}{p} \geq p$ or, equivalently, $d \geq p^{2}$. As $p$ is a divisor of $n$, it occurs in the array. Let $a_{1}, \ldots, a_{k}$ all divisors of $n$ smaller than $p$. Then $p a_{1}, \ldots, p a_{k}$ are less than $p^{2}$ and hence less than $d$.
As $a_{1}, \ldots, a_{k}$ are all relatively prime with $p$, all the numbers $p a_{1}, \ldots, p a_{k}$ divide $n$. The numbers $a_{1}, \ldots, a_{k}, p a_{1}, \ldots, p a_{k}$ are pairwise different by construction. Thus there are at least $2 k+1$ divisors of $n$ not greater than $d$. So Mary's program checks divisibility of $d$ by at least $k+1$ smallest divisors of $n$, among which it finds $p$, and outputs "composite".
18. Every integer is coloured with exactly one of the colours BLUE, GREEN, RED, YELLOW. Can this be done in such a way that if $a, b, c, d$ are not all 0 and have the same colour, then $3 a-2 b \neq 2 c-3 d$ ?
Answer: Yes.
Solution: A colouring with the required property can be defined as follows. For a non-zero integer $k$ let $k^{*}$ be the integer uniquely defined by $k=5^{m} \cdot k^{*}$, where $m$ is a nonnegative integer and $5 \nmid k^{*}$. We also define $0^{*}=0$. Two non-zero integers $k_{1}, k_{2}$ receive the same colour if and only if $k_{1}^{*} \equiv k_{2}^{*}(\bmod 5)$; we assign 0 any colour.
Assume $a, b, c, d$ has the same colour and that $3 a-2 b=2 c-3 d$, which we rewrite as $3 a-2 b-2 c+3 d=0$. Dividing both sides by the largest power of 5 which simultaneously divides $a, b, c, d$ (this makes sense since not all of $a, b, c, d$ are 0 ), we obtain
$$
3 \cdot 5^{A} \cdot a^{*}-2 \cdot 5^{B} \cdot b^{*}-2 \cdot 5^{C} \cdot c^{*}+3 \cdot 5^{D} \cdot d^{*}=0,
$$
where $A, B, C, D$ are nonnegative integers at least one of which is equal to 0 . The above equality implies
$$
3\left(5^{A} \cdot a^{*}+5^{B} \cdot b^{*}+5^{C} \cdot c^{*}+5^{D} \cdot d^{*}\right) \equiv 0 \quad(\bmod 5) .
$$
Assume $a, b, c, d$ are all non-zero. Then $a^{*} \equiv b^{*} \equiv c^{*} \equiv d^{*} \not \equiv 0(\bmod 5)$. This implies
$$
5^{A}+5^{B}+5^{C}+5^{D} \equiv 0 \quad(\bmod 5)
$$
which is impossible since at least one of the numbers $A, B, C, D$ is equal to 0 . If one or more of $a, b, c, d$ are 0 , we simply omit the corresponding terms from (1), and the same conclusion holds.
19. Let $a$ and $b$ be positive integers. Prove that if $a^{3}+b^{3}$ is the square of an integer, then $a+b$ is not a product of two different prime numbers.
Solution: Suppose $a+b=p q$, where $p \neq q$ are two prime numbers. We may assume that $p \neq 3$. Since
$$
a^{3}+b^{3}=(a+b)\left(a^{2}-a b+b^{2}\right)
$$
is a square, the number $a^{2}-a b+b^{2}=(a+b)^{2}-3 a b$ must be divisible by $p$ and $q$, whence $3 a b$ must be divisible by $p$ and $q$. But $p \neq 3$, so $p \mid a$ or $p \mid b$; but $p \mid a+b$, so $p \mid a$ and $p \mid b$. Write $a=p k, b=p \ell$ for some integers $k, \ell$. Notice that $q=3$, since otherwise, repeating the above argument, we would have $q|a, q| b$ and $a+b>p q)$. So we have
$$
3 p=a+b=p(k+\ell)
$$
and we conclude that $a=p, b=2 p$ or $a=2 p, b=p$. Then $a^{3}+b^{3}=9 p^{3}$ is obviously not a square, a contradiction.
20. Let $n$ be a positive integer such that the sum of all the positive divisors of $n$ (except $n$ ) plus the number of these divisors is equal to $n$. Prove that $n=2 m^{2}$ for some integer $m$.
Solution: Let $t_{1}<t_{2}<\cdots<t_{s}$ be all positive odd divisors of $n$, and let $2^{k}$ be the maximal power of 2 that divides $n$. Then the full list of divisors of $n$ is the following:
$$
t_{1}, \ldots, t_{s}, 2 t_{1}, \ldots, 2 t_{s}, \ldots, 2^{k} t_{1}, \ldots, 2^{k} t_{s} .
$$
Hence,
$$
2 n=\left(2^{k+1}-1\right)\left(t_{1}+t_{2}+\cdots+t_{s}\right)+(k+1) s-1 .
$$
The right-hand side can be even only if both $k$ and $s$ are odd. In this case the number $n / 2^{k}$ has an odd number of divisors and therefore it is equal to a perfect square $r^{2}$. Writing $k=2 a+1$, we have $n=2^{k} r^{2}=2\left(2^{a} r\right)^{2}$.
|