7. (FIN 1) Show that any two points lying inside a regular $n$-gon $E$ can be joined by two circular arcs lying inside $E$ and meeting at an angle of at least $\left(1-\frac{2}{n}\right) \pi$.

Solution: 7. Assume that $P_{1}$ and $P_{2}$ are points inside $E$, and that the line $P_{1} P_{2}$ intersects the perimeter of $E$ at $Q_{1}$ and $Q_{2}$. If we prove the statement for $Q_{1}$ and $Q_{2}$, we are done, since these arcs can be mapped homothetically to join $P_{1}$ and $P_{2}$. Let $V_{1}, V_{2}$ be two vertices of $E$. Then applying two homotheties to the inscribed circle of $E$ one can find two arcs (one of them may be a side of $E)$ joining these two points, both tangent to the sides of $E$ that meet at $V_{1}$ and $V_{2}$. If $A$ is any point of the side $V_{2} V_{3}$, two homotheties with center $V_{1}$ take the arcs joining $V_{1}$ to $V_{2}$ and $V_{3}$ into arcs joining $V_{1}$ to $A$; their angle of incidence at $A$ remains $(1-2 / n) \pi$. Next, for two arbitrary points $Q_{1}$ and $Q_{2}$ on two different sides $V_{1} V_{2}$ and $V_{3} V_{4}$, we join $V_{1}$ and $V_{2}$ to $Q_{2}$ with pairs of arcs that meet at $Q_{2}$ and have an angle of incidence $(1-2 / n) \pi$. The two arcs that meet the line $Q_{1} Q_{2}$ again outside $E$ meet at $Q_{2}$ at an angle greater than or equal to $(1-2 / n) \pi$. Two homotheties with center $Q_{2}$ carry these arcs to ones meeting also at $Q_{1}$ with the same angle of incidence.


8. (FRA 2) Let $R$ be a rectangle that is the union of a finite number of rectangles $R_{i}, 1 \leq i \leq n$, satisfying the following conditions: (i) The sides of every rectangle $R_{i}$ are parallel to the sides of $R$. (ii) The interiors of any two different $R_{i}$ are disjoint. (iii) Every $R_{i}$ has at least one side of integral length. Prove that $R$ has at least one side of integral length.

Solution: 8. Let $A, B, C, D$ denote the vertices of $R$. We consider the set $\mathcal{S}$ of all points $E$ of the plane that are vertices of at least one rectangle, and its subset $\mathcal{S}^{\prime}$ consisting of those points in $\mathcal{S}$ that have both coordinates integral in the orthonormal coordinate system with point $A$ as the origin and lines $A B, A D$ as axes. First, to each $E \in \mathcal{S}$ we can assign an integer $n_{E}$ as the number of rectangles $R_{i}$ with one vertex at $E$. It is easy to check that $n_{E}=1$ if $E$ is one of the vertices $A, B, C, D$; in all other cases $n_{E}$ is either 2 or 4. Furthermore, for each rectangle $R_{i}$ we define $f\left(R_{i}\right)$ as the number of vertices of $R_{i}$ that belong to $\mathcal{S}^{\prime}$. Since every $R_{i}$ has at least one side of integer length, $f\left(R_{i}\right)$ can take only values 0,2 , or 4 . Therefore we have  $$ \sum_{i=1}^{n} f\left(R_{i}\right) \equiv 0(\bmod 2) $$  On the other hand, $\sum_{i=1}^{n} f\left(R_{i}\right)$ is equal to $\sum_{E \in \mathcal{S}^{\prime}} n_{E}$, implying that  $$ \sum_{E \in \mathcal{S}^{\prime}} n_{E} \equiv 0(\bmod 2) $$  However, since $n_{A}=1$, at least one other $n_{E}$, where $E \in \mathcal{S}^{\prime}$, must be odd, and that can happen only for $E$ being $B, C$, or $D$. We conclude that at least one of the sides of $R$ has integral length. Second solution. Consider the coordinate system introduced above. If $D$ is a rectangle whose sides are parallel to the axes of the system, it is easy to prove that  $$ \int_{D} \sin 2 \pi x \sin 2 \pi y d x d y=0 $$  if and only if at least one side of $D$ has integral length. This holds for all $R_{i}$ 's, so that adding up these equalities we get $\int_{R} \sin 2 \pi x \sin 2 \pi y d x d y=0$. Thus, $R$ also has a side of integral length.


9. (FRA 4) For all integers $n, n \geq 0$, there exist uniquely determined integers $a_{n}, b_{n}, c_{n}$ such that  $$ (1+4 \sqrt[3]{2}-4 \sqrt[3]{4})^{n}=a_{n}+b_{n} \sqrt[3]{2}+c_{n} \sqrt[3]{4} $$  Prove that $c_{n}=0$ implies $n=0$.

Solution: 9. From $a_{n+1}+b_{n+1} \sqrt[3]{2}+c_{n+1} \sqrt[3]{4}=\left(a_{n}+b_{n} \sqrt[3]{2}+c_{n} \sqrt[3]{4}\right)(1+4 \sqrt[3]{2}-4 \sqrt[3]{4})$ we obtain $a_{n+1}=a_{n}-8 b_{n}+8 c_{n}$. Since $a_{0}=1, a_{n}$ is odd for all $n$. For an integer $k>0$, we can write $k=2^{l} k^{\prime}, k^{\prime}$ being odd and $l$ a nonnegative integer. Let us set $v(k)=l$, and define $\beta_{n}=v\left(b_{n}\right), \gamma_{n}=v\left(c_{n}\right)$. We prove the following lemmas: Lemma 1. For every integer $p \geq 0, b_{2^{p}}$ and $c_{2^{p}}$ are nonzero, and $\beta_{2^{p}}=$ $\gamma_{2^{p}}=p+2$. Proof. By induction on $p$. For $p=0, b_{1}=4$ and $c_{1}=-4$, so the assertion is true. Suppose that it holds for $p$. Then  $$ (1+4 \sqrt[3]{2}-4 \sqrt[3]{4})^{2^{p+1}}=\left(a+2^{p+2}\left(b^{\prime} \sqrt[3]{2}+c^{\prime} \sqrt[3]{4}\right)\right)^{2} \text { with } a, b^{\prime}, \text { and } c^{\prime} \text { odd. } $$  Then we easily obtain that $(1+4 \sqrt[3]{2}-4 \sqrt[3]{4})^{2^{p+1}}=A+2^{p+3}(B \sqrt[3]{2}+$ $C \sqrt[3]{4}$ ), where $A, B=a b^{\prime}+2^{p+1} E, C=a c^{\prime}+2^{p+1} F$ are odd. Therefore Lemma 1 holds for $p+1$. Lemma 2. Suppose that for integers $n, m \geq 0, \beta_{n}=\gamma_{n}=\lambda>\beta_{m}=$ $\gamma_{m}=\mu$. Then $b_{n+m}, c_{n+m}$ are nonzero and $\beta_{n+m}=\gamma_{n+m}=\mu$. Proof. Calculating $\left(a^{\prime}+2^{\lambda}\left(b^{\prime} \sqrt[3]{2}+c^{\prime} \sqrt[3]{4}\right)\right)\left(a^{\prime \prime}+2^{\mu}\left(b^{\prime \prime} \sqrt[3]{2}+c^{\prime \prime} \sqrt[3]{4}\right)\right)$, with $a^{\prime}, b^{\prime}, c^{\prime}, a^{\prime \prime}, b^{\prime \prime}, c^{\prime \prime}$ odd, we easily obtain the product $A+2^{\mu}(B \sqrt[3]{2}+$ $C \sqrt[3]{4})$, where $A, B=a^{\prime} b^{\prime \prime}+2^{\lambda-\mu} E$, and $C=a^{\prime} c^{\prime \prime}+2^{\lambda-\mu} F$ are odd, which proves Lemma 2. Since every integer $n>0$ can be written as $n=2^{p_{r}}+\cdots+2^{p_{1}}$, with $0 \leq p_{1}<\cdots<p_{r}$, from Lemmas 1 and 2 it follows that $c_{n}$ is nonzero, and that $\gamma_{n}=p_{1}+2$. Remark. $b_{1989}$ and $c_{1989}$ are divisible by 4 , but not by 8 .


1. (AUS 3) The integer 9 can be written as a sum of two consecutive integers: $9=4+5$. Moreover, it can be written as a sum of (more than one) consecutive positive integers in exactly two ways: $9=4+5=2+3+4$. Is there an integer that can be written as a sum of 1990 consecutive integers and that can be written as a sum of (more than one) consecutive positive integers in exactly 1990 ways?

Solution: 1. Let $N$ be a number that can be written as a sum of 1990 consecutive integers and as a sum of consecutive positive integers in exactly 1990 ways. The former requirement gives us $N=m+(m+1)+\cdots+(m+1989)=$ $995(2 m+1989)$ for some $m$. Thus $2 \nmid N, 5 \mid N$, and $199 \mid N$. The latter requirement tells us that there are exactly 1990 ways to express $N$ as $n+(n+1)+\cdots+(n+k)$, or equivalently, express $2 N$ as $(k+1)(2 n+k)$. Since $N$ is odd, it follows that one of the factors $k+1$ and $2 n+k$ is odd and the other is divisible by 2 , but not by 4 . Evidently $k+1<2 n+k$. On the other hand, every factorization $2 N=a b, 1<a<b$, corresponds to a single pair $(n, k)$, where $n=\frac{b-a+1}{2}$ (which is an integer) and $k=a-1$. The number of such factorizations is equal to $d(2 N) / 2-1$ because $a=b$ is impossible (here $d(x)$ denotes the number of positive divisors of an $x \in \mathbb{N}$ ). Hence we must have $d(2 N)=2 \cdot 1991=3982$. Now let $2 N=$ $2 \cdot 5^{e_{1}} \cdot 199^{e_{2}} \cdot p_{3}^{e_{3}} \cdots p_{r}^{e_{r}}$ be a factorization of $2 N$ into prime numbers, where $p_{3}, \ldots, p_{r}$ are distinct primes other than 2,5 , and 199 and $e_{1}, \cdots, e_{r}$ are positive integers. Then $d(2 N)=2\left(e_{1}+1\right)\left(e_{2}+1\right) \cdots\left(e_{r}+1\right)$, from which we deduce $\left(e_{1}+1\right)\left(e_{2}+1\right) \cdots\left(e_{r}+1\right)=1991=11 \cdot 181$. We thus get $\left\{e_{1}, e_{2}\right\}=\{10,180\}$ and $e_{3}=\cdots=e_{r}=0$. Hence $N=5^{10} \cdot 199^{180}$ and $N=5^{180} \cdot 199^{10}$ are the only possible solutions. These numbers indeed satisfy the desired properties.


10. (ICE 2) A plane cuts a right circular cone into two parts. The plane is tangent to the circumference of the base of the cone and passes through the midpoint of the altitude. Find the ratio of the volume of the smaller part to the volume of the whole cone.

Solution: 10. Let $r$ be the radius of the base and $h$ the height of the cone. We may assume w.l.o.g. that $r=1$. Let $A$ be the top of the cone, $B C$ the diameter of the circumference of the base such that the plane touches the circumference at $B, O$ the center of the base, and $H$ the midpoint of $O A$ (also belonging to the plane). Let $B H$ cut the sheet of the cone at $D$. By applying Menelaus's theorem to $\triangle A O C$ and $\triangle B H O$, we conclude that $\frac{A D}{D C}=\frac{C B}{B O} \cdot \frac{O H}{H A}=\frac{1}{2}$ and $\frac{H D}{D B}=\frac{H A}{A O} \cdot \frac{O C}{C B}=\frac{1}{4}$. The plane cuts the cone in an ellipse whose major axis is $B D$. Let $E$ be the center of this ellipse and $F G$ its minor axis. We have $\frac{B E}{E D}=\frac{1}{2}$. Let $E^{\prime}, F^{\prime}, G^{\prime}$ be radial projections of $E, F, G$ from $A$ onto the base of the cone. Then $E$ sits on $B C$. Let $h(X)$ denote the height of a point $X$ with respect to the base of the cone. We have $h(E)=h(D) / 2=h / 3$.  Hence $E F=2 E^{\prime} F^{\prime} / 3$. Applying Menelaus's theorem to $\triangle B H O$ we get $\frac{O E^{\prime}}{E^{\prime} B}=\frac{B E}{E H} \cdot \frac{H A}{A O}=1$. Hence $E F=\frac{2}{3} \frac{\sqrt{3}}{2}=\frac{1}{\sqrt{3}}$. Let $d$ denote the distance from $A$ to the plane. Let $V_{1}$ and $V$ denote the volume of the cone above the plane (on the same side of the plane as $A$ ) and the total volume of the cone. We have  $$ \begin{aligned} \frac{V_{1}}{V} & =\frac{B E \cdot E F \cdot d}{h}=\frac{(2 B H / 3)(1 / \sqrt{3})\left(2 S_{A H B} / B H\right)}{h} \\ & =\frac{(2 / 3)(1 / \sqrt{3})(h / 2)}{h}=\frac{1}{3 \sqrt{3}} . \end{aligned} $$  Since this ratio is smaller than $1 / 2$, we have indeed selected the correct volume for our ratio.


11. (IND $\left.3^{\prime}\right)^{\mathrm{IMO}}$ Given a circle with two chords $A B, C D$ that meet at $E$, let $M$ be a point of chord $A B$ other than $E$. Draw the circle through $D, E$, and $M$. The tangent line to the circle $D E M$ at $E$ meets the lines $B C, A C$ at $F, G$, respectively. Given $\frac{A M}{A B}=\lambda$, find $\frac{G E}{E F}$.

Solution: 11. Assume $\mathcal{B}(A, E, M, B)$. Since $A, B, C, D$ lie on a circle, we have $\angle G C E=$ $\angle M B D$ and $\angle M A D=\angle F C E$. Since $F D$ is tangent to the circle around $\triangle E M D$ at $E$, we have $\angle M D E=\angle F E B=\angle A E G$. Consequently, $\angle C E F=180^{\circ}-\angle C E A-\angle F E B=180^{\circ}-\angle M E D-\angle M D E=\angle E M D$ and $\angle C E G=180^{\circ}-\angle C E F=180^{\circ}-\angle E M D=\angle D M B$. It follows that $\triangle C E F \sim \triangle A M D$ and $\triangle C E G \sim$ $\triangle B M D$. From the first similarity we obtain $C E \cdot M D=A M \cdot E F$, and from the second we obtain $C E$. $M D=B M \cdot E G$. Hence  $$ \begin{gathered} A M \cdot E F=B M \cdot E G \Longrightarrow \\ \frac{G E}{E F}=\frac{A M}{B M}=\frac{\lambda}{1-\lambda} . \end{gathered} $$  ![](https://cdn.mathpix.com/cropped/2024_11_18_8e985d6b9c83aa3e9d0eg-543.jpg?height=371&width=353&top_left_y=1023&top_left_x=894)  If $\mathcal{B}(A, M, E, B)$, interchanging the roles of $A$ and $B$ we similarly obtain $\frac{G E}{E F}=\frac{\lambda}{1-\lambda}$.


12. (IRE 1) Let $A B C$ be a triangle and $L$ the line through $C$ parallel to the side $A B$. Let the internal bisector of the angle at $A$ meet the side $B C$ at $D$ and the line $L$ at $E$ and let the internal bisector of the angle at $B$ meet the side $A C$ at $F$ and the line $L$ at $G$. If $G F=D E$, prove that $A C=B C$.

Solution: 12. Let $d(X, l)$ denote the distance of a point $X$ from a line $l$. Using the elementary facts that $A F: F C=c: a$ and $B D: D C=c: b$, we obtain $d(F, L)=\frac{a}{a+c} h_{c}$ and $d(D, L)=\frac{b}{b+c} h_{c}$, where $h_{a}$ is the altitude of $\triangle A B C$ from $A$. We also have $\angle F G C=\beta / 2, \angle D E C=\alpha / 2$. It follows that  $$ D E=\frac{d(D, L)}{\sin (\alpha / 2)} \quad \text { and } \quad F G=\frac{d(F, L)}{\sin (\beta / 2)} $$  Now suppose that $a>b$. Since the function $f(x)=\frac{x}{x+c}$ is strictly increasing, we deduce $d(F, L)>d(D, L)$. Furthermore, $\sin (\alpha / 2)>\sin (\beta / 2)$, so we get from (1) that $F G>D E$. Similarly, $a<b$ implies $F G<D E$. Hence we must have $a=b$, i.e., $A C=B C$.


13. (IRE 2) An eccentric mathematician has a ladder with $n$ rungs that he always ascends and descends in the following way: When he ascends, each step he takes covers $a$ rungs of the ladder, and when he descends, each step he takes covers $b$ rungs of the ladder, where $a$ and $b$ are fixed positive integers. By a sequence of ascending and descending steps he can climb from ground level to the top rung of the ladder and come back down to ground level again. Find, with proof, the minimum value of $n$, expressed in terms of $a$ and $b$.

Solution: 13. We will call the ground the "zeroth" rung. We will prove that the minimum $n$ is $n=a+b-(a, b)$. It is plain that if $(a, b)=k>1$, the scientist can climb only onto the rungs divisible by $k$ and we can just observe these rungs to obtain the situation equivalent to $a^{\prime}=a / k, b^{\prime}=b / k$, and $n^{\prime}=a^{\prime}+b^{\prime}-1$. Thus let us assume that $(a, b)=1$ and show that $n=a+b-1$. We obviously have $n>a$. Consider $n=a+b-k, k \geq 1$, and let us assume without loss of generality that $a>b$ (otherwise, we can reverse the problem starting from the top rung in our round trip). Then we can uniquely define the numbers $r_{i}, 0 \leq r_{i}<b$, by $r_{i} \equiv i a(\bmod b)$. We now describe the only possible sequence of moves. From a position $0 \leq p \leq b-k$ we can move only $a$ rungs upward and for $p>b-1$ we can move only $b$ rungs downward. If we end up at $b-k<p \leq b-1$, we are stuck. Hence, given that we are at $r_{i}$, if $r_{i} \leq b-k$, we can move to $a+r_{i}$, and when we descend as far as we can go we will end up at $r_{i+1} \equiv a+r_{i}(\bmod b)$. If the mathematician climbs to the highest rung and then comes back to $r_{i}=0$, then we deduce $b \mid i a$, so $i \geq b$. But since $(a, b)=1$, there exists $0<j<b$ such that $r_{j} \equiv j a \equiv b-1(\bmod b)$. Thus the mathematician has visited the position $b-1$. For him not to get stuck we must have $k \leq 1$ and $n \geq a+b-1$. For $n=a+b-1$ by induction he can come to any position $r_{i}, i \geq 0$, so he eventually comes to $r_{j}=b-1$, climbs to the highest rung, and then continues until he gets to $r_{b}=0$. Hence the answer to the problem is $n=a+b-1$.


14. (JAP 2) In the coordinate plane a rectangle with vertices $(0,0),(m, 0)$, $(0, n),(m, n)$ is given where both $m$ and $n$ are odd integers. The rectangle is partitioned into triangles in such a way that (i) each triangle in the partition has at least one side (to be called a "good" side) that lies on a line of the form $x=j$ or $y=k$, where $j$ and $k$ are integers, and the altitude on this side has length 1 ; (ii) each "bad" side (i.e., a side of any triangle in the partition that is not a "good" one) is a common side of two triangles in the partition. Prove that there exist at least two triangles in the partition each of which has two good sides.

Solution: 14. Let $V$ be the set of all midpoints of bad sides, and $E$ the set of segments connecting two points in $V$ that belong to the same triangle. Each edge in $E$ is parallel to exactly one good side and thus is parallel to the coordinate grid and has half-integer coordinates. Thus, the edges of $E$ are a subset of the grid formed by joining the centers of the squares in the original grid to each other. Let $G$ be a graph whose set of vertices is $V$ and set of edges is $E$. The degree of each vertex $X$, denoted by $d(X)$, is 0 , 1 , or 2 . We observe the following cases: (i) $d(X)=0$ for some $X$. Then both triangles containing $X$ have two good sides. (ii) $d(X)=1$ for some $X$. Since $\sum_{X \in V} d(X)=2|E|$ is even, it follows that at least another vertex $Y$ has the degree 1. Hence both $X$ and $Y$ belong to triangles having two good sides. (iii) $d(X)=2$ for all $X \in V$. We will show that this case cannot occur. We prove first that centers of all the squares of the $m \times n$ board belong to $V \cup E$. A bad side contains no points with half-integer coordinates in its interior other than its midpoint. Therefore either a point $X$ is in $V$, or it lies on the segment connecting the midpoints of the two bad sides. Evidently, the graph $G$ can be partitioned into disjoint cycles. Each center of a square is passed exactly once in exactly one cycle. Let us color the board black and white in a standard chessboard fashion. Each cycle passes through centers that must alternate in color, and hence it contains an equal number of black and white centers. Consequently, the numbers of black and white squares on the entire board must be equal, contradicting the condition that $m$ and $n$ are odd. Our proof is thus completed.


15. (MEX 2) Determine for which positive integers $k$ the set  $$ X=\{1990,1990+1,1990+2, \ldots, 1990+k\} $$  can be partitioned into two disjoint subsets $A$ and $B$ such that the sum of the elements of $A$ is equal to the sum of the elements of $B$.

Solution: 15. Let $S(Z)$ denote the sum of all the elements of a set $Z$. We have $S(X)=$ $(k+1) \cdot 1990+\frac{k(k+1)}{2}$. To partition the set into two parts with equal sums, $S(X)$ must be even and hence $\frac{k(k+1)}{2}$ must be even. Hence $k$ is of the form $4 r$ or $4 r+3$, where $r$ is an integer. For $k=4 r+3$ we can partition $X$ into consecutive fourtuplets $\{1990+$ $4 l, 1990+4 l+1,1990+4 l+2,1990+4 l+3\}$ for $0 \leq l \leq r$ and put $1990+4 l, 1990+4 l+3 \in A$ and $1990+4 l+1,1990+4 l+2 \in B$ for all $l$. This would give us $S(A)=S(B)=(3980+4 r+3)(r+1)$. For $k=4 r$ the numbers of elements in $A$ and $B$ must differ. Let us assume without loss of generality $|A|<|B|$. Then $S(A) \leq(1990+2 r+1)+(1990+$ $2 r+2)+\cdots+(1990+4 r)$ and $S(B) \geq 1990+1991+\cdots+(1990+2 r)$. Plugging these inequalities into the condition $S(A)=S(B)$ gives us $r \geq 23$ and consequently $k \geq 92$. We note that $B=\{1990,1991, \ldots, 2034,2052,2082\}$ and $A=\{2035,2036, \ldots, 2051,2053, \ldots, 2081\}$ is a partition for $k=92$ that satisfies $S(A)=S(B)$. To construct a partition out of higher $k=4 r$ we use the $k=92$ partition for the first 93 elements and construct for the remaining elements as was done for $k=4 r+3$. Hence we can construct a partition exactly for the integers $k$ of the form $k=4 r+3, r \geq 0$, and $k=4 r, r \geq 23$.


16. (NET 1) ${ }^{\text {IMO6 }}$ Is there a 1990-gon with the following properties (i) and (ii)? (i) All angles are equal; (ii) The lengths of the 1990 sides are a permutation of the numbers $1^{2}, 2^{2}, \ldots, 1989^{2}, 1990^{2}$.

Solution: 16. Let $A_{0} A_{1} \ldots A_{1989}$ be the desired 1990-gon. We also define $A_{1990}=A_{0}$. Let $O$ be an arbitrary point. For $1 \leq i \leq 1990$ let $B_{i}$ be a point such that $\overrightarrow{O B_{i}}=\overrightarrow{A_{i-1} A_{i}}$. We define $B_{0}=B_{1990}$. The points $B_{i}$ must satisfy the following properties: $\angle B_{i} O B_{i+1}=\frac{2 \pi}{1990}, 0 \leq i \leq 1989$, lengths of $O B_{i}$ are a permutation of $1^{2}, 2^{2}, \ldots, 1989^{2}, 1990^{2}$, and $\sum_{i=0}^{1989} \overrightarrow{O B_{i}}=\overrightarrow{0}$. Conversely, any such set of points $B_{i}$ corresponds to a desired 1990-gon. Hence, our goal is to construct vectors $\overrightarrow{O B_{i}}$ satisfying all the stated properties. Let us group vectors of lengths $(2 n-1)^{2}$ and $(2 n)^{2}$ into pairs and put them diametrically opposite each other. The length of the resulting vectors is $4 n-1$. The problem thus reduces to arranging vectors of lengths $3,7,11, \ldots, 3979$ at mutual angles of $\frac{2 \pi}{995}$ such that their sum is $\overrightarrow{0}$. We partition the 995 directions into 199 sets of five directions at mutual angles $\frac{2 \pi}{5}$. The directions when intersected with a unit circle form a regular pentagon. We group the set of lengths of vectors $3,7, \ldots, 3979$ into 199 sets of five consecutive elements of the set. We place each group of lengths on directions belonging to the same group of directions, thus constructing five vectors. We use that $\overrightarrow{O C_{1}}+\cdots+\overrightarrow{O C_{n}}=0$ where $O$ is the center of a regular $n$-gon $C_{1} \ldots C_{n}$. In other words, vectors of equal lengths along directions that form a regular $n$-gon cancel each other out. Such are the groups of five directions. Hence, we can assume for each group of five lengths for its lengths to be $\{0,4,8,12,16\}$. We place these five lengths in a random fashion on a single group of directions. We then rotate the configuration clockwise by $\frac{2 \pi}{199}$ to cover other groups of directions and repeat until all groups of directions are exhausted. It follows that all vectors of each of the lengths $\{0,4,8,12,16\}$ will form a regular 199-gon and will thus cancel each other out. We have thus constructed a way of obtaining points $B_{i}$ and have hence shown the existence of the 1990-gon satisfying $(i)$ and (ii).


17. (NET 3) Unit cubes are made into beads by drilling a hole through them along a diagonal. The beads are put on a string in such a way that they can move freely in space under the restriction that the vertices of two neighboring cubes are touching. Let $A$ be the beginning vertex and $B$ be the end vertex. Let there be $p \times q \times r$ cubes on the string $(p, q, r \geq 1)$. (a) Determine for which values of $p, q$, and $r$ it is possible to build a block with dimensions $p, q$, and $r$. Give reasons for your answers. (b) The same question as (a) with the extra condition that $A=B$.

Solution: 17. Let us set a coordinate system denoting the vertices of the block. The vertices of the unit cubes of the block can be described as $\{(x, y, z) \mid 0 \leq$ $x \leq p, 0 \leq y \leq q, 0 \leq z \leq r\}$, and we restrict our attention to only these points. Suppose the point $A$ is fixed at $(a, b, c)$. Then for every other necklace point $(x, y, z)$ numbers $x-a, y-b$, and $z-c$ must be of equal parity. Conversely, every point $(x, y, z)$ such that $x-a, y-b$, and $z-c$ are of the same parity has to be a necklace point. Consider the graph $G$ whose vertices are all such points and edges are all diagonals of the unit cubes through these points. In part (a) we are looking for an open or closed Euler path, while in part (b) we are looking for a closed Euler path. Necklace points in the interior of the $(p, q, r)$ box have degree 8, points on the surface have degree 4 , points on the edge have degree 2 , and points on the corner have degree 1. A closed Euler path can be formed if and only if all vertices are of an even degree, while an open Euler path can be formed if and only if exactly two vertices have an odd degree. Hence the problem in part (a) amounts to being able to choose a point $A$ such that 0 or 2 corner vertices are necklace vertices, whereas in part (b) no corner points can be necklace vertices. We distinguish two cases. (i) At least two of $p, q, r$, say $p, q$, are even. We can choose $a=1, b=c=$ 0 . In this case none of the corners is a necklace point. Hence a closed Euler path exists. (ii) At most one of $p, q, r$ is even. However one chooses $A$, exactly two necklace points are at the corners. Hence, an open Euler path exists, but it is impossible to form a closed path. Hence, in part (a), a box can be made of all ( $p, q, r)$ and in part (b) only those $(p, q, r)$ where at least two of the numbers are even.


18. (NOR) Let $a, b$ be natural numbers with $1 \leq a \leq b$, and $M=\left[\frac{a+b}{2}\right]$. Define the function $f: \mathbb{Z} \rightarrow \mathbb{Z}$ by  $$ f(n)= \begin{cases}n+a, & \text { if } n<M \\ n-b, & \text { if } n \geq M\end{cases} $$  Let $f^{1}(n)=f(n), f^{i+1}(n)=f\left(f^{i}(n)\right), i=1,2, \ldots$. Find the smallest natural number $k$ such that $f^{k}(0)=0$.

Solution: 18. Clearly, it suffices to consider the case $(a, b)=1$. Let $S$ be the set of integers such that $M-b \leq x \leq M+a-1$. Then $f(S) \subseteq S$ and $0 \in S$. Consequently, $f^{k}(0) \in S$. Let us assume for $k>0$ that $f^{k}(0)=0$. Since $f(m)=m+a$ or $f(m)=m-b$, it follows that $k$ can be written as $k=r+s$, where $r a-s b=0$. Since $a$ and $b$ are relatively prime, it follows that $k \geq a+b$. Let us now prove that $f^{a+b}(0)=0$. In this case $a+b=r+s$ and hence $f^{a+b}(0)=(a+b-s) a-s b=(a+b)(a-s)$. Since $a+b \mid f^{a+b}(0)$ and $f^{a+b}(0) \in S$, it follows that $f^{a+b}(0)=0$. Thus for $(a, b)=1$ it follows that $k=a+b$. For other $a$ and $b$ we have $k=\frac{a+b}{(a, b)}$.


19. (POL 1) Let $P$ be a point inside a regular tetrahedron $T$ of unit volume. The four planes passing through $P$ and parallel to the faces of $T$ partition $T$ into 14 pieces. Let $f(P)$ be the joint volume of those pieces that are neither a tetrahedron nor a parallelepiped (i.e., pieces adjacent to an edge but not to a vertex). Find the exact bounds for $f(P)$ as $P$ varies over $T$.

Solution: 19. Let $d_{1}, d_{2}, d_{3}, d_{4}$ be the distances of the point $P$ to the tetrahedron. Let $d$ be the height of the regular tetrahedron. Let $x_{i}=d_{i} / d$. Clearly, $x_{1}+$ $x_{2}+x_{3}+x_{4}=1$, and given this condition, the parameters vary freely as we vary $P$ within the tetrahedron. The four tetrahedra have volumes $x_{1}^{3}, x_{2}^{3}, x_{3}^{3}$, and $x_{4}^{3}$, and the four parallelepipeds have volumes of $6 x_{2} x_{3} x_{4}$, $6 x_{1} x_{3} x_{4}, 6 x_{1} x_{2} x_{4}$, and $6 x_{1} x_{2} x_{3}$. Hence, using $x_{1}+x_{2}+x_{3}+x_{4}=1$ and setting $g(x)=x^{2}(1-x)$, we directly verify that  $$ \begin{aligned} f(P) & =f\left(x_{1}, x_{2}, x_{3}, x_{4}\right)=1-\sum_{i=1}^{4} x_{i}^{3}-6 \sum_{1 \leq i<j<k \leq 4} x_{i} x_{j} x_{k} \\ & =3\left(g\left(x_{1}\right)+g\left(x_{2}\right)+g\left(x_{3}\right)+g\left(x_{4}\right)\right) . \end{aligned} $$  We note that $g(0)=0$ and $g(1)=0$. Hence, as $x_{1}$ tends to 1 and other variables tend to $0, f\left(x_{1}, x_{2}, x_{3}, x_{4}\right)=0$. Thus $f(P)$ is sharply bounded downwards at 0 . We now find an upper bound. We note that  $$ \begin{aligned} g\left(x_{i}+x_{j}\right) & =\left(x_{i}+x_{j}\right)^{2}\left(1-x_{1}-x_{2}\right) \\ & =g\left(x_{i}\right)+g\left(x_{j}\right)+2 x_{i} x_{j}\left(1-\frac{3}{2}\left(x_{i}+x_{j}\right)\right) \end{aligned} $$  thus for $x_{i}+x_{j} \leq 2 / 3$ and $x_{i}, x_{j}>0$ we have $g\left(x_{i}+x_{j}\right)+g(0) \geq$ $g\left(x_{i}\right)+g\left(x_{j}\right)$. Equality holds only when $x_{i}+x_{j}=2 / 3$. Assuming without loss of generality $x_{1} \geq x_{2} \geq x_{3} \geq x_{4}$, we have $g\left(x_{1}\right)+$ $g\left(x_{2}\right)+g\left(x_{3}\right)+g\left(x_{4}\right)<g\left(x_{1}\right)+g\left(x_{2}\right)+g\left(x_{3}+x_{4}\right)$. Assuming $y_{1}+y_{2}+y_{3}=1$ and $y_{1} \geq y_{2} \geq y_{3}$, we have $g\left(y_{1}\right)+g\left(y_{2}\right)+g\left(y_{3}\right) \leq g\left(y_{1}\right)+g\left(y_{2}+y_{3}\right)$. Hence $g\left(x_{1}\right)+g\left(x_{2}\right)+g\left(x_{3}\right)+g\left(x_{4}\right)<g(x)+g(1-x)$ for some $x$. We also have $g(x)+g(1-x)=x(1-x) \leq 1 / 4$. Hence $f(P) \leq 3 / 4$. Equality holds for $x_{1}=x_{2}=1 / 2, x_{3}=x_{4}=0$ (corresponding to the midpoint of an edge), and as the variables converge to these values, $f(P)$ converges to $3 / 4$. Hence the bounds for $f(P)$ are  $$ 0<f(P)<\frac{3}{4} $$


2. (CAN 1) Given $n$ countries with three representatives each, $m$ committees $A(1), A(2), \ldots A(m)$ are called $a$ cycle if (i) each committee has $n$ members, one from each country; (ii) no two committees have the same membership; (iii) for $i=1,2, \ldots, m$, committee $A(i)$ and committee $A(i+1)$ have no member in common, where $A(m+1)$ denotes $A(1)$; (iv) if $1<|i-j|<m-1$, then committees $A(i)$ and $A(j)$ have at least one member in common. Is it possible to have a cycle of 1990 committees with 11 countries?

Solution: 2. We will call a cycle with $m$ committees and $n$ countries an $(m, n)$ cycle. We will number the delegates from each country with numbers $1,2,3$ and denote committees by arrays of these integers (of length $n$ ) defining which of the delegates from each country is in the committee. We will first devise methods of constructing larger cycles out of smaller cycles. Let $A_{1}, \ldots, A_{m}$ be an $(m, n)$ cycle, where $m$ is odd. Then the following is a $(2 m, n+1)$ cycle:  $$ \left(A_{1}, 1\right),\left(A_{2}, 2\right), \ldots,\left(A_{m}, 1\right),\left(A_{1}, 2\right),\left(A_{2}, 1\right), \ldots,\left(A_{m}, 2\right) $$  Also, let $A_{1}, \ldots, A_{m}$ be an $(m, n)$ cycle and $k \leq m$ an even integer. Then the cycle  $$ \begin{gathered} \left(A_{1}, 3\right),\left(A_{2}, 1\right),\left(A_{3}, 2\right), \ldots,\left(A_{k-2}, 1\right),\left(A_{k-1}, 2\right) \\ \left(A_{k}, 3\right),\left(A_{k-1}, 1\right),\left(A_{k-2}, 2\right), \ldots,\left(A_{2}, 2\right) \end{gathered} $$  is a $(2(k-1), n+1)$ cycle. Starting from the $((1),(2),(3))$ cycle with parameters $(3,1)$ we can sequentially construct larger cycles using the shown methods. The obtained cycles have parameters as follows:  $$ (6,2),(10,3), \ldots,\left(2^{k}+2, k\right), \ldots,(1026,10),(1990,11) $$  Thus there exists a cycle of 1990 committees with 11 countries.


20. (POL 3) Prove that every integer $k$ greater than 1 has a multiple that is less than $k^{4}$ and can be written in the decimal system with at most four different digits.

Solution: 20. Let $n$ be the unique integer such that $2^{n-1} \leq k<2^{n}$. Let $S(n)$ be the set of numbers less than $10^{n}$ that are written with only the digits $\{0,1\}$ in the decimal system. Evidently $|S(n)|=2^{n}>k$ and hence there exist two numbers $x, y \in S(n)$ such that $k \mid x-y$. Let us show that $w=|x-y|$ is the desired number. By definition $k \mid w$. We also have  $$ w<1.2 \cdot 10^{n-1} \leq 1.2 \cdot\left(2^{3} \sqrt{2}\right)^{n-1} \leq 1.2 \cdot k^{3} \sqrt{k} \leq k^{4} $$  Finally, since $x, y \in S(n)$, it follows that $w=|x-y|$ can be written using only the digits $\{0,1,8,9\}$. This completes the proof.


21. (ROM $\mathbf{1}^{\prime}$ ) Let $n$ be a composite natural number and $p$ a proper divisor of $n$. Find the binary representation of the smallest natural number $N$ such that $\frac{\left(1+2^{p}+2^{n-p}\right) N-1}{2^{n}}$ is an integer.

Solution: 21. We must solve the congruence $\left(1+2^{p}+2^{n-p}\right) N \equiv 1\left(\bmod 2^{n}\right)$. Since $(1+$ $2^{p}+2^{n-p}$ ) and $2^{n}$ are coprime, there clearly exists a unique $N$ satisfying this equation and $0<N<2^{n}$. Let us assume $n=m p$. Then we have $\left(1+2^{p}\right)\left(\sum_{j=0}^{m-1}(-1)^{j} 2^{j p}\right) \equiv$ $1\left(\bmod 2^{n}\right)$ and $\left(1+2^{n-p}\right)\left(1-2^{n-p}\right) \equiv 1\left(\bmod 2^{n}\right)$. By multiplying the two congruences we obtain  $$ \left(1+2^{p}\right)\left(1+2^{n-p}\right)\left(1-2^{n-p}\right)\left(\sum_{j=0}^{m-1}(-1)^{j} 2^{j p}\right) \equiv 1\left(\bmod 2^{n}\right) $$  Since $\left(1+2^{p}\right)\left(1+2^{n-p}\right) \equiv\left(1+2^{p}+2^{n-p}\right)\left(\bmod 2^{n}\right)$, it follows that $N \equiv$ $\left(1-2^{n-p}\right)\left(\sum_{j=0}^{m-1}(-1)^{j} 2^{j p}\right)\left(\bmod 2^{n}\right)$. The integer $N=\sum_{j=0}^{m-1}(-1)^{j} 2^{j p}-$ $2^{n-p}+2^{n}$ satisfies the congruence and $0<N \leq 2^{n}$. Using that for $a>b$ we have in binary representation  $$ 2^{a}-2^{b}=\underbrace{11 \ldots 11}_{a-b \text { times }} \underbrace{00 \ldots 00}_{b \text { times }} $$  the binary representation of $N$ is calculated as follows:  $$ N=\left\{\begin{array}{cc} \underbrace{11 \ldots 11}_{p \text { times }} \underbrace{11 \ldots 11}_{p \text { times }} \underbrace{00 \ldots 00}_{p \text { times }} \ldots \underbrace{11 \ldots 11}_{p \text { times }} \underbrace{00 \ldots 00}_{p-1 \text { times }} 1, & 2 \nmid \frac{n}{p} \\ \underbrace{11 \ldots 11}_{p-1 \text { times }} \underbrace{00 \ldots 00}_{p+1} \underbrace{11 \ldots 11}_{p \text { times }} \underbrace{00 \ldots 00}_{p \text { times }} \ldots \underbrace{11 \ldots 11}_{p \text { times }} \underbrace{00 \ldots 00}_{p-1 \text { times }} 1, & 2 \left\lvert\, \frac{n}{p}\right. \end{array}\right. $$


22. (ROM 4) Ten localities are served by two international airlines such that there exists a direct service (without stops) between any two of these localities and all airline schedules offer round-trip service between the cities they serve. Prove that at least one of the airlines can offer two disjoint round trips each containing an odd number of landings.

Solution: 22. We can assume without loss of generality that each connection is serviced by only one airline and the problem reduces to finding two disjoint monochromatic cycles of the same color and of odd length on a complete graph of 10 points colored by two colors. We use the following two standard lemmas: Lemma 1. Given a complete graph on six points whose edges are colored with two colors there exists a monochromatic triangle. $\operatorname{Proof}$. Let us denote the vertices by $c_{1}, c_{2}, c_{3}, c_{4}, c_{5}, c_{6}$. By the pigeonhole principle at least three vertices out of $c_{1}$, say $c_{2}, c_{3}, c_{4}$, are of the same color, let us call it red. Assuming that at least one of the edges connecting points $c_{2}, c_{3}, c_{4}$ is red, the connected points along with $c_{1}$ form a red triangle. Otherwise, edges connecting $c_{2}, c_{3}, c_{4}$ are all of the opposite color, let us call it blue, and hence in all cases we have a monochromatic triangle. Lemma 2. Given a complete graph on five points whose edges are colored two colors there exists a monochromatic triangle or a monochromatic cycle of length five. Proof. Let us denote the vertices by $c_{1}, c_{2}, c_{3}, c_{4}, c_{5}$. Assume that out of a point $c_{i}$ three vertices are of the same color. We can then proceed as in Lemma 1 to obtain a monochromatic triangle. Otherwise, each point is connected to other points with exactly two red and two blue vertices. Hence, we obtain monochromatic cycles starting from a single point and moving along the edges of the same color. Since each cycle must be of length at least three (i.e., we cannot have more than one cycle of one color), it follows that for both red and blue we must have one cycle of length five of that color. We now apply the lemmas. Let us denote the vertices by $c_{1}, c_{2}, \ldots, c_{10}$. We apply Lemma 1 to vertices $c_{1}, \ldots, c_{6}$ to obtain a monochromatic triangle. Out of the seven remaining vertices we select 6 and again apply Lemma 1 to obtain another monochromatic triangle. If they are of the same color, we are done. Otherwise, out of the nine edges connecting the two triangles of opposite color at least 5 are of the same color, we can assume blue w.l.o.g., and hence a vertex of a red triangle must contain at least two blue edges whose endpoints are connected with a blue edge. Hence there exist two triangles of different colors joined at a vertex. These take up five points. Applying Lemma 2 on the five remaining points, we obtain a monochromatic cycle of odd length that is of the same color as one of the two joined triangles and disjoint from both of them.


23. (ROM 5) ${ }^{\mathrm{IMO} 3}$ Find all positive integers $n$ having the property that $\frac{2^{n}+1}{n^{2}}$ is an integer.

Solution: 23. Let us assume $n>1$. Obviously $n$ is odd. Let $p \geq 3$ be the smallest prime divisor of $n$. In this case $(p-1, n)=1$. Since $2^{n}+1 \mid 2^{2 n}-1$, we have that $p \mid 2^{2 n}-1$. Thus it follows from Fermat's little theorem and elementary number theory that $p \mid\left(2^{2 n}-1,2^{p-1}-1\right)=2^{(2 n, p-1)}-1$. Since $(2 n, p-1) \leq 2$, it follows that $p \mid 3$ and hence $p=3$. Let us assume now that $n$ is of the form $n=3^{k} d$, where $2,3 \nmid d$. We first prove that $k=1$. Lemma. If $2^{m}-1$ is divisible by $3^{r}$, then $m$ is divisible by $3^{r-1}$. Proof. This is the lemma from (SL97-14) with $p=3, a=2^{2}, k=m$, $\alpha=1$, and $\beta=r$. Since $3^{2 k}$ divides $n^{2} \mid 2^{2 n}-1$, we can apply the lemma to $m=2 n$ and $r=2 k$ to conclude that $3^{2 k-1} \mid n=3^{k} d$. Hence $k=1$. Finally, let us assume $d>1$ and let $q$ be the smallest prime factor of $d$. Obviously $q$ is odd, $q \geq 5$, and $(n, q-1) \in\{1,3\}$. We then have $q \mid 2^{2 n}-1$ and $q \mid 2^{q-1}-1$. Consequently, $q \mid 2^{(2 n, q-1)}-1=2^{2(n, q-1)}-1$, which divides $2^{6}-1=63=3^{2} \cdot 7$, so we must have $q=7$. However, in that case we obtain $7|n| 2^{n}+1$, which is a contradiction, since powers of two can only be congruent to 1,2 and 4 modulo 7 . It thus follows that $d=1$ and $n=3$. Hence $n>1 \Rightarrow n=3$. It is easily verified that $n=1$ and $n=3$ are indeed solutions. Hence these are the only solutions.


24. (THA 2) Let $a, b, c, d$ be nonnegative real numbers such that $a b+b c+$ $c d+d a=1$. Show that  $$ \frac{a^{3}}{b+c+d}+\frac{b^{3}}{a+c+d}+\frac{c^{3}}{a+b+d}+\frac{d^{3}}{a+b+c} \geq \frac{1}{3} $$  ![](https://cdn.mathpix.com/cropped/2024_11_18_8e985d6b9c83aa3e9d0eg-262.jpg?height=62&width=1190&top_left_y=791&top_left_x=173) a function $f: \mathbb{Q}^{+} \rightarrow \mathbb{Q}^{+}$such that  $$ f(x f(y))=\frac{f(x)}{y}, \quad \text { for all } x, y \text { in } \mathbb{Q}^{+} $$

Solution: 24. Let us denote $A=b+c+d, B=a+c+d, C=a+b+d, D=a+b+c$. Since $a b+b c+c d+d a=1$ the numbers $A, B, C, D$ are all positive. By trivially applying the AM-GM inequality we have:  $$ a^{2}+b^{2}+c^{2}+d^{2} \geq a b+b c+c d+d a=1 . $$  We will prove the inequality assuming only that $A, B, C, D$ are positive and $a^{2}+b^{2}+c^{2}+d^{2} \geq 1$. In this case we may assume without loss of generality that $a \geq b \geq c \geq d \geq 0$. Hence $a^{3} \geq b^{3} \geq c^{3} \geq d^{3} \geq 0$ and $\frac{1}{A} \geq \frac{1}{B} \geq \frac{1}{C} \geq \frac{1}{D}>0$. Using the Chebyshev and Cauchy inequalities we obtain:  $$ \begin{aligned} & \frac{a^{3}}{A}+\frac{b^{3}}{B}+\frac{c^{3}}{C}+\frac{d^{3}}{D} \\ & \geq \frac{1}{4}\left(a^{3}+b^{3}+c^{3}+d^{3}\right)\left(\frac{1}{A}+\frac{1}{B}+\frac{1}{C}+\frac{1}{D}\right) \\ & \geq \frac{1}{16}\left(a^{2}+b^{2}+c^{2}+d^{2}\right)(a+b+c+d)\left(\frac{1}{A}+\frac{1}{B}+\frac{1}{C}+\frac{1}{D}\right) \\ & =\frac{1}{48}\left(a^{2}+b^{2}+c^{2}+d^{2}\right)(A+B+C+D)\left(\frac{1}{A}+\frac{1}{B}+\frac{1}{C}+\frac{1}{D}\right) \geq \frac{1}{3} \end{aligned} $$  This completes the proof.


26. (USA 2) Let $P$ be a cubic polynomial with rational coefficients, and let $q_{1}, q_{2}, q_{3}, \ldots$ be a sequence of rational numbers such that $q_{n}=P\left(q_{n+1}\right)$ for all $n \geq 1$. Prove that there exists $k \geq 1$ such that for all $n \geq 1, q_{n+k}=q_{n}$.

Solution: 26. We note that $|P(x) / x| \rightarrow \infty$. Hence, there exists an integer number $M$ such that $M>\left|q_{1}\right|$ and $|P(x)| \leq|x| \Rightarrow|x|<M$. It follows that $\left|q_{i}\right|<M$ for all $i \in \mathbb{N}$ because assuming $\left|q_{i}\right| \geq M$ for some $i$ we get $\left|q_{i-1}\right|=$ $\left|P\left(q_{i}\right)\right|>\left|q_{i}\right| \geq M$ and this ultimately contradicts $\left|q_{1}\right|<M$. Let us define $q_{1}=\frac{r}{s}$ and $P(x)=\frac{a x^{3}+b x^{2}+c x+d}{e}$ where $r, s, a, b, c, d, e$ are all integers. For $N=s a$ we shall prove by induction that $N q_{i}$ is an integer for all $i \in \mathbb{N}$. By definition $N \neq 0$.  For $i=1$ this obviously holds. Assume it holds for some $i \in \mathbb{N}$. Then using $q_{i}=P\left(q_{i+1}\right)$ we have that $N q_{i+1}$ is a zero of the polynomial  $$ \begin{aligned} Q(x) & =\frac{e}{a} N^{3}\left(P\left(\frac{x}{N}\right)-q_{i}\right) \\ & =x^{3}+(s b) x^{2}+\left(s^{2} a c\right) x+\left(s^{3} a^{2} d-s^{2} a e\left(N q_{i}\right)\right) . \end{aligned} $$  Since $Q(x)$ is a monic polynomial with integer coefficients (a conclusion for which we must assume the induction hypothesis) and $N q_{i+1}$ is rational it follows by the rational root theorem that $N q_{i+1}$ is an integer. It follows that all $q_{i}$ are multiples of $1 / N$. Since $-M<q_{i}<M$ we conclude that $q_{i}$ can take less than $T=2 M|N|$ distinct values. Therefore for each $j$ there are $m_{j}$ and $m_{j}+k_{j}\left(k_{j}>0\right)$ both belonging to the set $\{j T+1, j T+2, \ldots, j T+T\}$ such that $q_{m_{j}}=q_{m_{j}+k_{j}}$. Since $k_{j}<T$ for all $k_{j}$ it follows that there exists a positive integer $k$ which appears an infinite number of times in the sequence $k_{j}$, i.e. there exist infinitely many integers $m$ such that $q_{m}=q_{m+k}$. Moreover, $q_{m}=q_{m+k}$ clearly implies $q_{n}=q_{n+k}$ for all $n \leq m$. Hence $q_{n}=q_{n+k}$ holds for all $n$.


27. (USS 1) Find all natural numbers $n$ for which every natural number whose decimal representation has $n-1$ digits 1 and one digit 7 is prime.

Solution: 27. Let us denote by $A_{n}(k)$ the $n$-digit number which consists of $n-1$ ones and one digit seven in the $k+1$-th rightmost position $(0 \leq k<n)$. Then $A_{n}(k)=\left(10^{n}+54 \cdot 10^{k}-1\right) / 9$. We note that if $3 \mid n$ we have that $3 \mid A_{n}(k)$ for all $k$. Hence $n$ cannot be divisible by 3 . Now let $3 \nmid n$. We claim that for each such $n \geq 5$, there exists $k<n$ for which $7 \mid A_{n}(k)$. We see that $A_{n}(k)$ is divisible by 7 if and only if $10^{n}-1 \equiv 2 \cdot 10^{k}(\bmod 7)$. There are several cases.  $$ \begin{aligned} & n \equiv 1(\bmod 6) \text {. Then } 10^{n}-1 \equiv 2 \equiv 2 \cdot 10^{0} \text {, so } 7 \mid A_{n}(0) \text {. } \\ & n \equiv 2(\bmod 6) \text {. Then } 10^{n}-1 \equiv 1 \equiv 2 \cdot 10^{4} \text {, so } 7 \mid A_{n}(4) . \\ & n \equiv 4(\bmod 6) . \text { Then } 10^{n}-1 \equiv 3 \equiv 2 \cdot 10^{5} \text {, so } 7 \mid A_{n}(5) \text {. } \\ & n \equiv 5(\bmod 6) \text {. Then } 10^{n}-1 \equiv 4 \equiv 2 \cdot 10^{2} \text {, so } 7 \mid A_{n}(2) . \end{aligned} $$  The remaining cases are $n=1,2,4$. For $n=4$ the number $1711=29 \cdot 59$ is composite, while it is easily checked that $n=1$ and $n=2$ are solutions. Hence the answer is $n=1,2$.


28. (USS 3) Prove that on the coordinate plane it is impossible to draw a closed broken line such that (i) the coordinates of each vertex are rational; (ii) the length each of its edges is 1 ; (iii) the line has an odd number of vertices.

Solution: 28. Let us first prove the following lemma.  Lemma. Let $\left(b^{\prime} / a^{\prime}, d^{\prime} / c^{\prime}\right)$ and $\left(b^{\prime \prime} / a^{\prime \prime}, d^{\prime \prime} / c^{\prime \prime}\right)$ be two points with rational coordinates where the fractions given are irreducible. If both $a^{\prime}$ and $c^{\prime}$ are odd and the distance between the two points is 1 then it follows that $a^{\prime \prime}$ and $c^{\prime \prime}$ are odd, and that $b^{\prime}+d^{\prime}$ and $b^{\prime \prime}+d^{\prime \prime}$ are of a different parity. Proof. Let $b / a$ and $d / c$ be irreducible fractions such that $b^{\prime} / a^{\prime}-b^{\prime \prime} / a^{\prime \prime}=$ $b / a$ and $d^{\prime} / c^{\prime}-d^{\prime \prime} / c^{\prime \prime}=d / c$. Then it follows that $b^{2} / a^{2}+d^{2} / c^{2}=$ $1 \Rightarrow b^{2} c^{2}+a^{2} d^{2}=a^{2} c^{2}$. Since $(a, b)=1$ and $(c, d)=1$ it follows that $a|c, c| a$ and hence $a=c$. Consequently $b^{2}+d^{2}=a^{2}$. Since $a$ is mutually co-prime to $b$ and $d$ it follows that $a$ and $b+d$ are odd. From $b^{\prime \prime} / a^{\prime \prime}=b / a+b^{\prime} / a^{\prime}$ we get that $a^{\prime \prime} \mid a a^{\prime}$, so $a^{\prime \prime}$ is odd. Similarly, $c^{\prime \prime}$ is odd as well. Now it follows that $b^{\prime \prime} \equiv b+b^{\prime}$ and similarly $d^{\prime \prime} \equiv d+d^{\prime}$ $(\bmod 2)$. Hence $b^{\prime \prime}+d^{\prime \prime} \equiv b^{\prime}+d^{\prime}+b+d \equiv b^{\prime}+d^{\prime}+1(\bmod 2)$, from which it follows that $b^{\prime}+d^{\prime}$ and $b^{\prime \prime}+d^{\prime \prime}$ are of a different parity. Without loss of generality we start from the origin of the coordinate system $(0 / 1,0 / 1)$. Initially $b+d=0$ and after moving to each subsequent point along the broken line $b+d$ changes parity by the lemma. Hence it will not be possible to return to the origin after an odd number of steps since $b+d$ will be odd.


3. $(\mathbf{C Z S} 1)^{\mathrm{IMO} 2}$ On a circle, $2 n-1(n \geq 3)$ different points are given. Find the minimal natural number $N$ with the property that whenever $N$ of the given points are colored black, there exist two black points such that the interior of one of the corresponding arcs contains exactly $n$ of the given $2 n-1$ points.

Solution: 3. A segment connecting two points which divides the given circle into two arcs one of which contains exactly $n$ points in its interior we will call a good segment. Good segments determine one or more closed polygonal lines that we will call stars. Let us compute the number of stars. Note first that $\operatorname{gcd}(n+1,2 n-1)=\operatorname{gcd}(n+1,3)$. (i) Suppose that $3 \nmid n+1$. Then the good segments form a single star. Among any $n$ points, two will be adjacent vertices of the star. On the other hand, we can select $n-1$ alternate points going along the star, and in this case no two points lie on a good segment. Hence $N=n$. (ii) If $3 \mid n+1$, we obtain three stars of $\left[\frac{2 n-1}{3}\right]$ vertices. If more than $\left[\frac{2 n-1}{6}\right]=\frac{n-2}{3}$ points are chosen on any of the stars, then two of them will be connected with a good segment. On the other hand, we can select $\frac{n-2}{3}$ alternate points on each star, which adds up to $n-2$ points in total, no two of which lie on a good segment. Hence $N=n-1$. To sum up, $N=n$ for $3 \nmid 2 n-1$ and $N=n-1$ for $3 \mid 2 n-1$.


4. (CZS 2) Assume that the set of all positive integers is decomposed into $r$ (disjoint) subsets $A_{1} \cup A_{2} \cup \cdots A_{r}=\mathbb{N}$. Prove that one of them, say $A_{i}$, has the following property: There exists a positive $m$ such that for any $k$ one can find numbers $a_{1}, a_{2}, \ldots, a_{k}$ in $A_{i}$ with $0<a_{j+1}-a_{j} \leq m$ $(1 \leq j \leq k-1)$.

Solution: 4. Assuming that $A_{1}$ is not such a set $A_{i}$, it follows that for every $m$ there exist $m$ consecutive numbers not in $A_{1}$. It follows that $A_{2} \cup A_{3} \cup \cdots \cup A_{r}$ contains arbitrarily long sequences of numbers. Inductively, let us assume that $A_{j} \cup A_{j+1} \cup \cdots \cup A_{r}$ contains arbitrarily long sequences of consecutive numbers and none of $A_{1}, A_{2}, \ldots, A_{j-1}$ is the desired set $A_{i}$. Let us assume that $A_{j}$ is also not $A_{i}$. Hence for each $m$ there exists $k(m)$ such that among $k(m)$ elements of $A_{j}$ there exist two consecutive elements that differ by at least $m$. Let us consider $m \cdot k(m)$ consecutive numbers in $A_{j} \cup \cdots \cup A_{r}$, which exist by the induction hypothesis. Then either $A_{j}$ contains fewer than $k(m)$ of these integers, in which case $A_{j+1} \cup \cdots \cup A_{r}$ contains $m$ consecutive integers by the pigeonhole principle or $A_{j}$ contains $k(m)$ integers among which there exists a gap of length $m$ of consecutive integers that belong to $A_{j+1} \cup \cdots \cup A_{r}$. Hence we have proven that $A_{j+1} \cup \cdots \cup A_{r}$ contains sequences of integers of arbitrary length. By induction, assuming that $A_{1}, A_{2}, \ldots, A_{r-1}$ do not satisfy the conditions to be the set $A_{i}$, it follows that $A_{r}$ contains sequences of consecutive integers of arbitrary length and hence satisfies the conditions necessary for it to be the set $A_{i}$.


5. (FRA 1) Given $\triangle A B C$ with no side equal to another side, let $G, K$, and $H$ be its centroid, incenter, and orthocenter, respectively. Prove that $\angle G K H>90^{\circ}$.

Solution: 5. Let $O$ be the circumcenter of $A B C, E$ the midpoint of $O H$, and $R$ and $r$ the radii of the circumcircle and incircle respectively. We use the following facts from elementary geometry: $\overrightarrow{O H}=3 \overrightarrow{O G}, O K^{2}=R^{2}-2 R r$, and $K E=\frac{R}{2}-r$. Hence $\overrightarrow{K H}=2 \overrightarrow{K E}-\overrightarrow{K O}$ and $\overrightarrow{K G}=\frac{2 \overrightarrow{K E}+\overrightarrow{K O}}{3}$. We then obtain  $$ \overrightarrow{K H} \cdot \overrightarrow{K G}=\frac{1}{3}\left(4 K E^{2}-K O^{2}\right)=-\frac{2}{3} r(R-2 r)<0 . $$  Hence $\cos \angle G K H<0 \Rightarrow \angle G K H>90^{\circ}$.


6. (FRG 2) ${ }^{\mathrm{IMO} 5}$ Two players $A$ and $B$ play a game in which they choose numbers alternately according to the following rule: At the beginning, an initial natural number $n_{0}>1$ is given. Knowing $n_{2 k}$, player $A$ may choose any $n_{2 k+1} \in \mathbb{N}$ such that  $$ n_{2 k} \leq n_{2 k+1} \leq n_{2 k}^{2} $$  Then player $B$ chooses a number $n_{2 k+2} \in \mathbb{N}$ such that  $$ \frac{n_{2 k+1}}{n_{2 k+2}}=p^{r} $$  where $p$ is a prime number and $r \in \mathbb{N}$. It is stipulated that player $A$ wins the game if he (she) succeeds in choosing the number 1990, and player $B$ wins if he (she) succeeds in choosing 1.  For which natural numbers $n_{0}$ can player $A$ manage to win the game, for which $n_{0}$ can player $B$ manage to win, and for which $n_{0}$ can players $A$ and $B$ each force a tie?

Solution: 6. Let $W$ denote the set of all $n_{0}$ for which player $A$ has a winning strategy, $L$ the set of all $n_{0}$ for which player $B$ has a winning strategy, and $T$ the set of all $n_{0}$ for which a tie is ensured.  Lemma. Assume $\{m, m+1, \ldots 1990\} \subseteq W$ and that there exists $s \leq 1990$ such that $s / p^{r} \geq m$, where $p^{r}$ is the largest degree of a prime that divides $s$. Then all integers $x$ such that $\sqrt{s} \leq x<m$ also belong in W.  Proof. Starting from $x$, player $A$ can choose $s$, and by definition of $s$, player $B$ cannot choose a number smaller than $m$. This ensures player $A$ the victory. We now have trivially that since $45^{2}=2025>1990$, it follows that for $n_{0} \in\{45, \ldots, 1990\}$ player $A$ can choose 1990 in the first move. Hence $\{45, \ldots, 1990\} \subseteq W$. Using $m=45$ and selecting $s=420=2^{2} \cdot 3 \cdot 5 \cdot 7$ we apply the lemma to get that all integers $x$ such that $\sqrt{420}<21 \leq x \leq 1990$ are in $W$. Again, using $m=21$ and selecting $s=168=2^{3} \cdot 3 \cdot 7$ we apply the lemma to get that all integers $x$ such that $\sqrt{168}<13 \leq x \leq 1990$ are in $W$. Selecting $s=105$ we obtain the new value for $m$ at $m=11$. Selecting $s=60$ we obtain $m=8$. Thus $\{8, \ldots, 1990\} \subseteq W$. For $n_{0}>1990$ there exists $r \in N$ such that $2^{r} \cdot 3^{2}<n_{0} \leq 2^{r+1} \cdot 3^{2}<n_{0}^{2}$. Player $A$ can take $n_{1}=2^{r+1} \cdot 3^{2}$. The number player $B$ selects has to satisfy $8 \leq n_{2}<n_{0}$. After finitely many steps he will select $8 \leq n_{2 r} \leq 1990$, and $A$ will have a winning strategy. Hence all $m \geq 8$ belong to $W$. Now let us consider the case $n_{0} \leq 5$. Since the smallest number divisible by three different primes is 30 and $n_{0}^{2} \leq 5^{2}=25<30$, it follows that $n_{1}$ is of the form $n_{1}=p^{r}$ or $n_{1}=p^{r} \cdot q^{s}$, where $p$ and $q$ are two different primes. In the first case player $B$ can choose 1 and win, while in the second case he can select the smaller of $p^{r}, q^{s}$, which is also smaller than $\sqrt{n_{1}} \leq n_{0}$. Thus player $B$ can eventually reach $n_{2 k}=1$. Thus $\{2,3,4,5\} \subseteq L$. Finally, for $n_{0}=6$ or $n_{0}=7$ player $A$ must select a number divisible by at least three primes, which must be $30=2 \cdot 3 \cdot 5$ or $42=2 \cdot 3 \cdot 7$; otherwise, $B$ can select a degree of a prime smaller than $n_{0}$, yielding $n_{2}<6$ and victory for $B$. Player $B$ must select a number smaller than 8 . Hence, he has to select 6 in both cases. Afterwards, to avoid losing the game, player $A$ will always choose 30 and player $B$ always 6 . In this case we would have a tie. Hence $T \subseteq\{6,7\}$. Considering that we have accounted for all integers $n_{0}>1$, the final solution is $L=\{2,3,4,5\}, T=\{6,7\}$, and $W=\{x \in \mathbb{N} \mid x \geq 8\}$.


Solution: 7. Let $f(n)=g(n) 2^{n^{2}}$ for all $n$. The recursion then transforms into $g(n+$ 2) $-2 g(n+1)+g(n)=n \cdot 16^{-n-1}$ for $n \in \mathbb{N}_{0}$. By summing this equation from 0 to $n-1$, we get  $$ g(n+1)-g(n)=\frac{1}{15^{2}} \cdot\left(1-(15 n+1) 16^{-n}\right) $$  By summing up again from 0 to $n-1$ we get $g(n)=\frac{1}{15^{3}} \cdot(15 n-32+$ $\left.(15 n+2) 16^{-n+1}\right)$. Hence  $$ f(n)=\frac{1}{15^{3}} \cdot\left(15 n+2+(15 n-32) 16^{n-1}\right) \cdot 2^{(n-2)^{2}} $$  Now let us look at the values of $f(n)$ modulo 13:  $$ f(n) \equiv 15 n+2+(15 n-32) 16^{n-1} \equiv 2 n+2+(2 n-6) 3^{n-1} $$  We have $3^{3} \equiv 1(\bmod 13)$. Plugging in $n \equiv 1(\bmod 13)$ and $n \equiv 1(\bmod$ 3 ) for $n=1990$ gives us $f(1990) \equiv 0(\bmod 13)$. We similarly calculate $f(1989) \equiv 0$ and $f(1991) \equiv 0(\bmod 13)$.


8. (HUN 1) For a given positive integer $k$ denote the square of the sum of its digits by $f_{1}(k)$ and let $f_{n+1}(k)=f_{1}\left(f_{n}(k)\right)$. Determine the value of $f_{1991}\left(2^{1990}\right)$.

Solution: 8. Since $2^{1990}<8^{700}<10^{700}$, we have $f_{1}\left(2^{1990}\right)<(9 \cdot 700)^{2}<4 \cdot 10^{7}$. We then have $f_{2}\left(2^{1990}\right)<(3+9 \cdot 7)^{2}<4900$ and finally $f_{3}\left(2^{1990}\right)<(3+9 \cdot 3)^{2}=30^{2}$. It is easily shown that $f_{k}(n) \equiv f_{k-1}(n)^{2}(\bmod 9)$. Since $2^{6} \equiv 1(\bmod 9)$, we have $2^{1990} \equiv 2^{4} \equiv 7$ (all congruences in this problem will be $\bmod 9$ ). It follows that $f_{1}\left(2^{1990}\right) \equiv 7^{2} \equiv 4$ and $f_{2}\left(2^{1990}\right) \equiv 4^{2} \equiv 7$. Indeed, it follows that $f_{2 k}\left(2^{1990}\right) \equiv 7$ and $f_{2 k+1}\left(2^{1990}\right) \equiv 4$ for all integer $k>0$. Thus $f_{3}\left(2^{1990}\right)=r^{2}$ where $r<30$ is an integer and $r \equiv f_{2}\left(2^{1990}\right) \equiv 7$. It follows that $r \in\{7,16,25\}$ and hence $f_{3}\left(2^{1990}\right) \in\{49,256,625\}$. It follows that $f_{4}\left(2^{1990}\right)=169, f_{5}\left(2^{1990}\right)=256$, and inductively $f_{2 k}\left(2^{1990}\right)=169$ and $f_{2 k+1}\left(2^{1990}\right)=256$ for all integer $k>1$. Hence $f_{1991}\left(2^{1990}\right)=256$.


9. (HUN 3) The incenter of the triangle $A B C$ is $K$. The midpoint of $A B$ is $C_{1}$ and that of $A C$ is $B_{1}$. The lines $C_{1} K$ and $A C$ meet at $B_{2}$, the lines $B_{1} K$ and $A B$ at $C_{2}$. If the areas of the triangles $A B_{2} C_{2}$ and $A B C$ are equal, what is the measure of angle $\angle C A B$ ?

Solution: 9. Let $a, b, c$ be the lengths of the sides of $\triangle A B C, s=\frac{a+b+c}{2}, r$ the inradius of the triangle, and $c_{1}$ and $b_{1}$ the lengths of $A B_{2}$ and $A C_{2}$ respectively. As usual we will denote by $S(X Y Z)$ the area of $\triangle X Y Z$. We have  $$ \begin{gathered} S\left(A C_{1} B_{2}\right)=\frac{A C_{1} \cdot A B_{2}}{A C \cdot A B} S(A B C)=\frac{c_{1} r s}{2 b} \\ S\left(A K B_{2}\right)=\frac{c_{1} r}{2}, \quad S\left(A C_{1} K\right)=\frac{c r}{4} \end{gathered} $$  From $S\left(A C_{1} B_{2}\right)=S\left(A K B_{2}\right)+S\left(A C_{1} K\right)$ we get $\frac{c_{1} r s}{2 b}=\frac{c_{1} r}{2}+\frac{c r}{4}$; therefore $(a-b+c) c_{1}=b c$. By looking at the area of $\triangle A B_{1} C_{2}$ we similarly obtain $(a+b-c) b_{1}=b c$. From these two equations and from $S(A B C)=S\left(A B_{2} C_{2}\right)$, from which we have $b_{1} c_{1}=b c$, we obtain  $$ a^{2}-(b-c)^{2}=b c \Rightarrow \frac{b^{2}+c^{2}-a^{2}}{2 b c}=\cos (\angle B A C)=\frac{1}{2} \Rightarrow \angle B A C=60^{\circ} $$


1. (PHI 3) Let $A B C$ be any triangle and $P$ any point in its interior. Let $P_{1}, P_{2}$ be the feet of the perpendiculars from $P$ to the two sides $A C$ and $B C$. Draw $A P$ and $B P$, and from $C$ drop perpendiculars to $A P$ and $B P$. Let $Q_{1}$ and $Q_{2}$ be the feet of these perpendiculars. Prove that the lines $Q_{1} P_{2}, Q_{2} P_{1}$, and $A B$ are concurrent.

Solution: 1. All the angles $\angle P P_{1} C, \angle P P_{2} C, \angle P Q_{1} C, \angle P Q_{2} C$ are right, hence $P_{1}, P_{2}$, $Q_{1}, Q_{2}$ lie on the circle with diameter $P C$. The result now follows immediately from Pascal's theorem applied to the hexagon $P_{1} P P_{2} Q_{1} C Q_{2}$. It tells us that the points of intersection of the three pairs of lines $P_{1} C, P Q_{1}$ (intersection $A$ ), $P_{1} Q_{2}, P_{2} Q_{1}$ (intersection ![](https://cdn.mathpix.com/cropped/2024_11_18_8e985d6b9c83aa3e9d0eg-553.jpg?height=333&width=335&top_left_y=376&top_left_x=919) $X)$ and $P Q_{2}, P_{2} C$ (intersection $B$ ) are collinear.


10. (USA 5) ${ }^{\mathrm{IMO} 4}$ Suppose $G$ is a connected graph with $n$ edges. Prove that it is possible to label the edges of $G$ from 1 to $n$ in such a way that in every vertex $v$ of $G$ with two or more incident edges, the set of numbers labeling those edges has no common divisor greater than 1.

Solution: 10. We start at some vertex $v_{0}$ and walk along distinct edges of the graph, numbering them $1,2, \ldots$ in the order of appearance, until this is no longer possible without reusing an edge. If there are still edges which are not numbered, one of them has a vertex which has already been visited (else $G$ would not be connected). Starting from this vertex, we continue to walk along unused edges resuming the numbering, until we eventually get stuck. Repeating this procedure as long as possible, we shall number all the edges. Let $v$ be a vertex which is incident with $e \geq 2$ edges. If $v=v_{0}$, then it is on the edge 1 , so the gcd at $v$ is 1 . If $v \neq v_{0}$, suppose that it was reached for the first time by the edge $r$. At that time there was at least one unused edge incident with $v$ (as $e \geq 2$ ), hence one of them was labelled by $r+1$. The gcd at $v$ again equals $\operatorname{gcd}(r, r+1)=1$.


Solution: 11. To start with, observe that $\frac{1}{n-m}\binom{n-m}{m}=\frac{1}{n}\left[\binom{n-m}{m}+\binom{n-m-1}{m-1}\right]$.  For $n=1,2, \ldots$ set $S_{n}=\sum_{m=0}^{[n / 2]}(-1)^{m}\binom{n-m}{m}$. Using the identity $\binom{m}{k}=$ $\binom{m-1}{k}+\binom{m-1}{k-1}$ we obtain the following relation for $S_{n}$ :  $$ \begin{aligned} S_{n+1} & =\sum_{m}(-1)^{m}\binom{n-m+1}{m} \\ & =\sum_{m}(-1)^{m}\binom{n-m}{m}+\sum_{m}(-1)^{m}\binom{n-m}{m-1}=S_{n}-S_{n-1} . \end{aligned} $$  Since the initial members of the sequence $S_{n}$ are $1,1,0,-1,-1,0,1,1, \ldots$, we thus find that $S_{n}$ is periodic with period 6 . Now the sum from the problem reduces to  $$ \begin{gathered} \frac{1}{1991}\binom{1991}{0}-\frac{1}{1991}\left[\binom{1990}{1}+\binom{1989}{0}\right]+\cdots-\frac{1}{1991}\left[\binom{996}{995}+\binom{995}{994}\right] \\ =\frac{1}{1991}\left(S_{1991}-S_{1989}\right)=\frac{1}{1991}(0-(-1))=\frac{1}{1991} . \end{gathered} $$


12. $(\mathbf{C H N} 3)^{\mathrm{IMO} 3}$ Let $S=\{1,2,3, \ldots, 280\}$. Find the minimal natural number $n$ such that in any $n$-element subset of $S$ there are five numbers that are pairwise relatively prime.

Solution: 12. Let $A_{m}$ be the set of those elements of $S$ which are divisible by $m$. By the inclusion-exclusion principle, the number of elements divisible by $2,3,5$ or 7 equals  $$ \begin{aligned} & \left|A_{2} \cup A_{3} \cup A_{5} \cup A_{7}\right| \\ & =\left|A_{2}\right|+\left|A_{3}\right|+\left|A_{5}\right|+\left|A_{7}\right|-\left|A_{6}\right|-\left|A_{10}\right|-\left|A_{14}\right|-\left|A_{15}\right| \\ & \quad-\left|A_{21}\right|-\left|A_{35}\right|+\left|A_{30}\right|+\left|A_{42}\right|+\left|A_{70}\right|+\left|A_{105}\right|-\left|A_{210}\right| \\ & =140+93+56+40-46-28-20-18 \\ & \quad-13-8+9+6+4+2-1=216 . \end{aligned} $$  Among any five elements of the set $A_{2} \cup A_{3} \cup A_{5} \cup A_{7}$, one of the sets $A_{2}, A_{3}, A_{5}, A_{7}$ contains at least two, and those two are not relatively prime. Therefore $n>216$.  We claim that the answer is $n=217$. First notice that the set $A_{2} \cup A_{3} \cup$ $A_{5} \cup A_{7}$ consists of four prime $(2,3,5,7)$ and 212 composite numbers. The set $S \backslash A$ contains exactly 8 composite numbers: namely, $11^{2}, 11 \cdot 13,11$. $17,11 \cdot 19,11 \cdot 23,13^{2}, 13 \cdot 17,13 \cdot 19$. Thus $S$ consists of the unity, 220 composite numbers and 59 primes. Let $A$ be a 217 -element subset of $S$, and suppose that there are no five pairwise relatively prime numbers in $A$. Then $A$ can contain at most 4 primes (or unity and three primes) and at least 213 composite numbers. Hence the set $S \backslash A$ contains at most 7 composite numbers. Consequently, at least one of the following 8 five-element sets is disjoint with $S \backslash A$, and is thus entirely contained in $A$ :  $$ \begin{array}{ll} \{2 \cdot 23,3 \cdot 19,5 \cdot 17,7 \cdot 13,11 \cdot 11\}, & \{2 \cdot 29,3 \cdot 23,5 \cdot 19,7 \cdot 17,11 \cdot 13\}, \\ \{2 \cdot 31,3 \cdot 29,5 \cdot 23,7 \cdot 19,11 \cdot 17\}, & \{2 \cdot 37,3 \cdot 31,5 \cdot 29,7 \cdot 23,11 \cdot 19\}, \\ \{2 \cdot 41,3 \cdot 37,5 \cdot 31,7 \cdot 29,11 \cdot 23\}, & \{2 \cdot 43,3 \cdot 41,5 \cdot 37,7 \cdot 31,13 \cdot 17\}, \\ \{2 \cdot 47,3 \cdot 43,5 \cdot 41,7 \cdot 37,13 \cdot 19\}, & \{2 \cdot 2,3 \cdot 3,5 \cdot 5,7 \cdot 7,13 \cdot 13\} . \end{array} $$  As each of these sets consists of five numbers relatively prime in pairs, the claim is proved.


13. (POL 4) Given any integer $n \geq 2$, assume that the integers $a_{1}, a_{2}, \ldots, a_{n}$ are not divisible by $n$ and, moreover, that $n$ does not divide $a_{1}+a_{2}+$ $\cdots+a_{n}$. Prove that there exist at least $n$ different sequences $\left(e_{1}, e_{2}, \cdots, e_{n}\right)$ consisting of zeros or ones such that $e_{1} a_{1}+e_{2} a_{2}+\cdots+e_{n} a_{n}$ is divisible by $n$.

Solution: 13. Call a sequence $e_{1}, \ldots, e_{n}$ good if $e_{1} a_{1}+\cdots+e_{n} a_{n}$ is divisible by $n$. Among the sums $s_{0}=0, s_{1}=a_{1}, s_{2}=a_{1}+a_{2}, \ldots, s_{n}=a_{1}+\cdots+a_{n}$, two give the same remainder modulo $n$, and their difference corresponds to a good sequence. To show that, permuting the $a_{i}$ 's, we can find $n-1$ different sequences, we use the following Lemma. Let $A$ be a $k \times n(k \leq n-2)$ matrix of zeros and ones, whose every row contains at least one 0 and at least two 1 's. Then it is possible to permute columns of $A$ is such a way that in any row 1 's do not form a block. Proof. We will use the induction on $k$. The case $k=1$ and arbitrary $n \geq 3$ is trivial. Suppose that $k \geq 2$ and that for $k-1$ and any $n \geq k+1$ the lemma is true. Consider a $k \times n$ matrix $A, n \geq k+2$. We mark an element $a_{i j}$ if either it is the only zero in the $i$-th row, or one of the 1 's in the row if it contains exactly two 1 's. Since $n \geq 4$, every row contains at most two marked elements, which adds up to at most $2 k<2 n$ marked elements in total. It follows that there is a column with at most one marked element. Assume w.l.o.g. that it is the first column and that $a_{1 j}$ isn't marked for $j>1$. The matrix $B$, obtained by omitting the first row and first column from $A$, satisfies the conditions of the lemma. Therefore, we can permute columns of $B$ and get the required form. Considered as a permutation of column of $A$, this permutation may leave a block of 1's only in the first row of $A$. In the case that it is so, if $a_{11}=1$ we put the first column in the last place, otherwise we put it between any two columns having 1's in the first row. The obtained matrix has the required property. Suppose now that we have got $k$ different nontrivial good sequences $e_{1}^{i}, \ldots, e_{n}^{i}, i=1, \ldots, k$, and that $k \leq n-2$. The matrix $A=\left(e_{j}^{i}\right)$ fulfils the conditions of Lemma, hence there is a permutation $\sigma$ from Lemma. Now among the sums $s_{0}=0, s_{1}=a_{\sigma(1)}, s_{2}=a_{\sigma(1)}+a_{\sigma(2)}$, $\ldots, s_{n}=a_{\sigma(1)}+\cdots+a_{\sigma(n)}$, two give the same remainder modulo $n$. Let $s_{p} \equiv s_{q}(\bmod n), p<q$. Then $n \mid s_{q}-s_{p}=a_{\sigma(p+1)}+\cdots+a_{\sigma(q)}$, and this yields a good sequence $e_{1}, \ldots, e_{n}$ with $e_{\sigma(p+1)}=\cdots=e_{\sigma(q)}=1$ and other $e$ 's equal to zero. Since from the construction we see that none of the sequences $e_{\sigma(j)^{i}}$ has all 1's in a block, in this way we have got a new nontrivial good sequence, and we can continue this procedure until there are $n-1$ sequences. Together with the trivial $0, \ldots, 0$ sequence, we have found $n$ good sequences.


14. (POL 3) Let $a, b, c$ be integers and $p$ an odd prime number. Prove that if $f(x)=a x^{2}+b x+c$ is a perfect square for $2 p-1$ consecutive integer values of $x$, then $p$ divides $b^{2}-4 a c$.

Solution: 14. Suppose that $f\left(x_{0}\right), f\left(x_{0}+1\right), \ldots, f\left(x_{0}+2 p-2\right)$ are squares. If $p \mid a$ and $p \nmid b$, then $f(x) \equiv b x+c(\bmod p)$ for $x=x_{0}, \ldots, x_{0}+p-1$ form a complete system of residues modulo $p$. However, a square is always congruent to exactly one of the $\frac{p+1}{2}$ numbers $0,1^{2}, 2^{2}, \ldots,\left(\frac{p-1}{2}\right)^{2}$ and thus cannot give every residue modulo $p$. Also, if $p \mid a$ and $p \mid b$, then $p \mid b^{2}-4 a c$. We now assume $p \nmid a$. The following identities hold for any quadric polynomial:  $$ 4 a \cdot f(x)=(2 a x+b)^{2}-\left(b^{2}-4 a c\right) $$  and  $$ f(x+p)-f(x)=p(2 a x+b)+p^{2} a . $$  Suppose that there is an $y, x_{0} \leq y \leq x_{0}+p-2$, for which $f(y)$ is divisible by $p$. Then both $f(y)$ and $f(y+p)$ are squares divisible by $p$, and therefore both are divisible by $p^{2}$. But relation (2) implies that $p \mid 2 a y+b$, and hence by (1) $b^{2}-4 a c$ is divisible by $p$ as well. Therefore it suffices to show that such an $y$ exists, and for that aim we prove that there are two such $y$ in $\left[x_{0}, x_{0}+p-1\right]$. Assume the opposite. Since for $x=x_{0}, x_{0}+1, \ldots, x_{0}+p-1 f(x)$ is congruent modulo $p$ to one of the $\frac{p-1}{2}$ numbers $1^{2}, 2^{2}, \ldots,\left(\frac{p-1}{2}\right)^{2}$, it follows by the pigeon-hole principle that for some mutually distinct $u, v, w \in\left\{x_{0}, \ldots, x_{0}+p-1\right\}$ we have $f(u) \equiv f(v) \equiv f(w)(\bmod p)$. Consequently the difference $f(u)-f(v)=$ $(u-v)(a(u+v)+b)$ is divisible by $p$, but it is clear that $p \nmid u-v$, hence $a(u+v) \equiv-b(\bmod p)$. Similarly $a(u+w) \equiv-b(\bmod p)$, which together with the previous congruence yields $p|a(v-w) \Rightarrow p| v-w$ which is clearly impossible. It follows that $p \mid f\left(y_{1}\right)$ for at least one $y_{1}$, $x_{0} \leq y_{1}<x_{0}+p$. If $y_{2}, x_{0} \leq y_{2}<x_{0}+p$ is such that $a\left(y_{1}+y_{2}\right)+b \equiv 0(\bmod p)$, we have $p\left|f\left(y_{1}\right)-f\left(y_{2}\right) \Rightarrow p\right| f\left(y_{2}\right)$. If $y_{1}=y_{2}$, then by (1) $p \mid b^{2}-4 a c$. Otherwise, among $y_{1}, y_{2}$ one belongs to $\left[x_{0}, x_{0}+p-2\right]$ as required. Second solution. Using Legendre's symbols $\left(\frac{a}{p}\right)$ for quadratic residues we can prove a stronger statement for $p \geq 5$. It can be shown that  $$ \sum_{x=0}^{p-1}\left(\frac{a x^{2}+b x+c}{p}\right)=-\left(\frac{a}{p}\right) \quad \text { if } \quad p \nmid b^{2}-4 a c $$  hence for at most $\frac{p+3}{2}$ values of $x$ between $x_{0}$ and $x_{0}+p-1$ inclusive, $a x^{2}+b x+c$ is a quadratic residue or 0 modulo $p$. Therefore, if $p \geq 5$ and $f(x)$ is a square for $\frac{p+5}{2}$ consecutive values, then $p \mid b^{2}-4 a c$.


15. (USS 2) Let $a_{n}$ be the last nonzero digit in the decimal representation of the number $n$ !. Does the sequence $a_{1}, a_{2}, \ldots, a_{n}, \ldots$ become periodic after a finite number of terms?

Solution: 15. Assume that the sequence has the period $T$. We can find integers $k>m>$ 0 , as large as we like, such that $10^{k} \equiv 10^{m}(\bmod T)$, using for example Euler's theorem. It is obvious that $a_{10^{k}-1}=a_{10^{k}}$ and hence, taking $k$ sufficiently large and using the periodicity, we see that  $$ a_{2 \cdot 10^{k}-10^{m}-1}=a_{10^{k}-1}=a_{10^{k}}=a_{2 \cdot 10^{k}-10^{m}} $$  Since $\left(2 \cdot 10^{k}-10^{m}\right)!=\left(2 \cdot 10^{k}-10^{m}\right)\left(2 \cdot 10^{k}-10^{m}-1\right)!$ and the last nonzero digit of $2 \cdot 10^{k}-10^{m}$ is nine, we must have $a_{2 \cdot 10^{k}-10^{m}-1}=5$ (if $s$ is a digit, the last digit of $9 s$ is $s$ only if $s=5$ ). But this means that 5 divides $n$ ! with a greater power than 2 does, which is impossible. Indeed, if the exponents of these powers are $\alpha_{2}, \alpha_{5}$ respectively, then $\alpha_{5}=$ $[n / 5]+\left[n / 5^{2}\right]+\cdots \leq \alpha_{2}=[n / 2]+\left[n / 2^{2}\right]+\cdots$.


16. (ROM 1) ${ }^{\mathrm{IMO} 2}$ Let $n>6$ and $a_{1}<a_{2}<\cdots<a_{k}$ be all natural numbers that are less than $n$ and relatively prime to $n$. Show that if $a_{1}, a_{2}, \ldots, a_{k}$ is an arithmetic progression, then $n$ is a prime number or a natural power of two.

Solution: 16. Let $p$ be the least prime number that does not divide $n$ : thus $a_{1}=1$ and $a_{2}=p$. Since $a_{2}-a_{1}=a_{3}-a_{2}=\cdots=r$, the $a_{i}$ 's are $1, p, 2 p-1,3 p-2, \ldots$ We have the following cases: $p=2$. Then $r=1$ and the numbers $1,2,3, \ldots, n-1$ are relatively prime to $n$, hence $n$ is a prime. $p=3$. Then $r=2$, so every odd number less than $n$ is relatively prime to $n$, from which we deduce that $n$ has no odd divisors. Therefore $n=2^{k}$ for some $k \in \mathbb{N}$. $p>3$. Then $r=p-1$ and $a_{k+1}=a_{1}+k(p-1)=1+k(p-1)$. Since $n-1$ also must belong to the progression, we have $p-1 \mid n-2$. Let $q$ be any prime divisor of $p-1$. Then also $q \mid n-2$. On the other hand, since $q<p$, it must divide $n$ too, therefore $q \mid 2$, i.e. $q=2$. This means that $p-1$ has no prime divisors other than 2 and thus $p=2^{l}+1$ for some $l \geq 2$. But in order for $p$ to be prime, $l$ must be even (because $3 \mid 2^{l}+1$ for $l$ odd). Now we recall that $2 p-1$ is also relatively prime to $n$; but $2 p-1=2^{l+1}+1$ is divisible by 3 , which is a contradiction because $3 \mid n$.


17. (HKG 4) Find all positive integer solutions $x, y, z$ of the equation $3^{x}+$ $4^{y}=5^{z}$ 。

Solution: 17. Taking the equation $3^{x}+4^{y}=5^{z}(x, y, z>0)$ modulo 3 , we get that $5^{z} \equiv 1(\bmod 3)$, hence $z$ is even, say $z=2 z_{1}$. The equation then becomes $3^{x}=5^{2 z_{1}}-4^{y}=\left(5^{z_{1}}-2^{y}\right)\left(5^{z_{1}}+2^{y}\right)$. Each factor $5^{z_{1}}-2^{y}$ and $5^{z_{1}}+2^{y}$ is a power of 3 , for which the only possibility is $5^{z_{1}}+2^{y}=3^{x}$ and $5^{z_{1}}-2^{y}=$ 1. Again modulo 3 these equations reduce to $(-1)^{z_{1}}+(-1)^{y}=0$ and $(-1)^{z_{1}}-(-1)^{y}=1$, implying that $z_{1}$ is odd and $y$ is even. Particularly, $y \geq 2$. Reducing the equation $5^{z_{1}}+2^{y}=3^{x}$ modulo 4 we get that $3^{x} \equiv 1$, hence $x$ is even. Now if $y>2$, modulo 8 this equation yields $5 \equiv 5^{z_{1}} \equiv$ $3^{x} \equiv 1$, a contradiction. Hence $y=2, z_{1}=1$. The only solution of the original equation is $x=y=z=2$.


Solution: 18. For integers $a>0, n>0$ and $\alpha \geq 0$, we shall write $a^{\alpha} \| n$ when $a^{\alpha} \mid n$ and $a^{\alpha+1} \nmid n$. Lemma. For every odd number $a \geq 3$ and an integer $n \geq 0$ it holds that  $$ a^{n+1} \|(a+1)^{a^{n}}-1 \quad \text { and } \quad a^{n+1} \|(a-1)^{a^{n}}+1 $$  Proof. We shall prove the first relation by induction (the second is analogous). For $n=0$ the statement is obvious. Suppose that it holds for some $n$, i.e. that $(1+a)^{a^{n}}=1+N a^{n+1}, a \nmid N$. Then  $$ (1+a)^{a^{n+1}}=\left(1+N a^{n+1}\right)^{a}=1+a \cdot N a^{n+1}+\binom{a}{2} N^{2} a^{2 n+2}+M a^{3 n+3} $$  for some integer $M$. Since $\binom{a}{2}$ is divisible by $a$ for $a$ odd, we deduce that the part of the above sum behind $1+a \cdot N a^{n+1}$ is divisible by $a^{n+3}$. Hence $(1+a)^{a^{n+1}}=1+N^{\prime} a^{n+2}$, where $a \nmid N^{\prime}$. It follows immediately from Lemma that  $$ 1991^{1993} \| 1990^{1991^{1992}}+1 \quad \text { and } \quad 1991^{1991} \| 1992^{1991^{1990}}-1 $$  Adding these two relations we obtain immediately that $k=1991$ is the desired value.


19. (IRE 5) Let $a$ be a rational number with $0<a<1$ and suppose that  $$ \cos 3 \pi a+2 \cos 2 \pi a=0 $$  (Angle measurements are in radians.) Prove that $a=2 / 3$.

Solution: 19. Set $x=\cos (\pi a)$. The given equation is equivalent to $4 x^{3}+4 x^{2}-3 x-2=0$, which factorizes as $(2 x+1)\left(2 x^{2}+x-2\right)=0$. The case $2 x+1=0$ yields $\cos (\pi a)=-1 / 2$ and $a=2 / 3$. It remains to show that if $x$ satisfies $2 x^{2}+x-2=0$ then $a$ is not rational. The polynomial equation $2 x^{2}+x-2=0$ has two real roots, $x_{1,2}=\frac{-1 \pm \sqrt{17}}{4}$, and since $|x| \leq 1$ we must have $x=\cos \pi a=\frac{-1+\sqrt{17}}{4}$. We now prove by induction that, for every integer $n \geq 0, \cos \left(2^{n} \pi a\right)=$ $\frac{a_{n}+b_{n} \sqrt{17}}{4}$ for some odd integers $a_{n}, b_{n}$. The case $n=0$ is trivial. Also, if $\cos \left(2^{n} \pi a\right)=\frac{a_{n}+b_{n} \sqrt{17}}{4}$, then  $$ \begin{aligned} \cos \left(2^{n+1} \pi a\right) & =2 \cos ^{2}\left(2^{n} \pi a\right)-1 \\ & =\frac{1}{4}\left(\frac{a_{n}^{2}+17 b_{n}^{2}-8}{2}+a_{n} b_{n} \sqrt{17}\right)=\frac{a_{n+1}+b_{n+1} \sqrt{17}}{4} . \end{aligned} $$  By the inductive step that $a_{n}, b_{n}$ are odd, it is obvious that $a_{n+1}, b_{n+1}$ are also odd. This proves the claim. Note also that, since $a_{n+1}=\frac{1}{2}\left(a_{n}^{2}+17 b_{n}^{2}-8\right)>a_{n}$, the sequence $\left\{a_{n}\right\}$ is strictly increasing. Hence the set of values of $\cos \left(2^{n} \pi a\right), n=0,1,2, \ldots$, is infinite (because $\sqrt{17}$ is irrational). However, if $a$ were rational, then the set of values of $\cos m \pi a, m=1,2, \ldots$, would be finite, a contradiction. Therefore the only possible value for $a$ is $2 / 3$.


2. (JAP 5) For an acute triangle $A B C, M$ is the midpoint of the segment $B C, P$ is a point on the segment $A M$ such that $P M=B M, H$ is the foot of the perpendicular line from $P$ to $B C, Q$ is the point of intersection of segment $A B$ and the line passing through $H$ that is perpendicular to $P B$, and finally, $R$ is the point of intersection of the segment $A C$ and the line passing through $H$ that is perpendicular to $P C$. Show that the circumcircle of $\triangle Q H R$ is tangent to the side $B C$ at point $H$.

Solution: 2. Let $H Q$ meet $P B$ at $Q^{\prime}$ and $H R$ meet $P C$ at $R^{\prime}$. From $M P=M B=M C$ we have $\angle B P C=90^{\circ}$. So $P R^{\prime} H Q^{\prime}$ is a rectangle. Since $P H$ is perpendicular to $B C$, it follows that the circle with diameter $P H$, through $P, R^{\prime}, H, Q^{\prime}$, is tangent to $B C$. It is now sufficient to show that $Q R$ is parallel to $Q^{\prime} R^{\prime}$. Let $C P$ meet $A B$ at $X$, and $B P$ meet $A C$ at $Y$. Since $P$ is on the median, it follows (for ![](https://cdn.mathpix.com/cropped/2024_11_18_8e985d6b9c83aa3e9d0eg-553.jpg?height=403&width=432&top_left_y=806&top_left_x=877) example, by Ceva's theorem) that $A X / X B=A Y / Y C$, i.e. that $X Y$ is parallel to $B C$. Consequently, $P Y / B P=P X / C P$. Since $H Q$ is parallel to $C X$, we have $Q Q^{\prime} / H Q^{\prime}=$ $P X / C P$ and similarly $R R^{\prime} / H R^{\prime}=P Y / B P$. It follows that $Q Q^{\prime} / H Q^{\prime}=$ $R R^{\prime} / H R^{\prime}$, hence $Q R$ is parallel to $Q^{\prime} R^{\prime}$ as required. Second solution. It suffices to show that $\angle R H C=\angle R Q H$, or equivalently $R H: Q H=P C: P B$. We assume $P C: P B=1: x$. Let $X \in A B$ and $Y \in A C$ be points such that $M X \perp P B$ and $M Y \perp P C$. Since $M X$ bisects $\angle A M B$ and $M Y$ bisects $A M C$, we deduce  $$ \begin{aligned} & A X: X B=A M: M B=A Y: Y C \Rightarrow X Y \| B C \Rightarrow \\ & \quad \Rightarrow \triangle X Y M \sim \triangle C B P \Rightarrow X M: M Y=1: x . \end{aligned} $$  Now from $C H: H B=1: x^{2}$ we obtain $R H: M Y=C H: C M=1: \frac{1+x^{2}}{2}$ and $Q H: M X=B H: B M=x^{2}: \frac{1+x^{2}}{2}$. Therefore  $$ R H: Q H=\frac{2}{1+x^{2}} M Y: \frac{2 x^{2}}{1+x^{2}} M X=1: x $$


20. (IRE 3) Let $\alpha$ be the positive root of the equation $x^{2}=1991 x+1$. For natural numbers $m, n$ define  $$ m * n=m n+[\alpha m][\alpha n] $$  where $[x]$ is the greatest integer not exceeding $x$. Prove that for all natural numbers $p, q, r$,  $$ (p * q) * r=p *(q * r) $$

Solution: 20. We prove the result with 1991 replaced by any positive integer $k$. For natural numbers $p, q$, let $\epsilon=(\alpha p-[\alpha p])(\alpha q-[\alpha q])$. Then $0<\epsilon<1$ and  $$ \epsilon=\alpha^{2} p q-\alpha(p[\alpha q]+q[\alpha p])+[\alpha p][\alpha q] . $$  Multiplying this equality by $\alpha-k$ and using $\alpha^{2}=k \alpha+1$, i.e. $\alpha(\alpha-k)=1$, we get  $$ (\alpha-k) \epsilon=\alpha(p q+[\alpha p][\alpha q])-(p[\alpha q]+q[\alpha p]+k[\alpha p][\alpha q]) $$  Since $0<(\alpha-k) \epsilon<1$, we have $[\alpha(p * q)]=p[\alpha q]+q[\alpha p]+k[\alpha p][\alpha q]$. Now  $$ \begin{aligned} (p * q) * r & =(p * q) r+[\alpha(p * q)][\alpha r]= \\ & =p q r+[\alpha p][\alpha q] r+[\alpha q][\alpha r] p+[\alpha r][\alpha p] q+k[\alpha p][\alpha q][\alpha r] . \end{aligned} $$  Since the last expression is symmetric, the same formula is obtained for $p *(q * r)$.


21. (HKG 6) Let $f(x)$ be a monic polynomial of degree 1991 with integer coefficients. Define $g(x)=f^{2}(x)-9$. Show that the number of distinct integer solutions of $g(x)=0$ cannot exceed 1995.

Solution: 21. The polynomial $g(x)$ factorizes as $g(x)=f(x)^{2}-9=(f(x)-3)(f(x)+3)$. If one of the equations $f(x)+3=0$ and $f(x)-3=0$ has no integer solutions, then the number of integer solutions of $g(x)=0$ clearly does not exceed 1991. Suppose now that both $f(x)+3=0$ and $f(x)-3=0$ have integer solutions. Let $x_{1}, \ldots, x_{k}$ be distinct integer solutions of the former, and $x_{k+1}, \ldots, x_{k+l}$ be distinct integer solutions of the latter equation. There exist monic polynomials $p(x), q(x)$ with integer coefficients such that $f(x)+3=\left(x-x_{1}\right)\left(x-x_{2}\right) \ldots\left(x-x_{k}\right) p(x)$ and $f(x)-3=$ $\left(x-x_{k+1}\right)\left(x-x_{k+2}\right) \ldots\left(x-x_{k+l}\right) q(x)$. Thus we obtain $\left(x-x_{1}\right)\left(x-x_{2}\right) \ldots\left(x-x_{k}\right) p(x)-\left(x-x_{k+1}\right)\left(x-x_{k+2}\right) \ldots\left(x-x_{k+l}\right) q(x)=6$. Putting $x=x_{k+1}$ we get $\left(x_{k+1}-x_{1}\right)\left(x_{k+1}-x_{2}\right) \cdots\left(x_{k+1}-x_{k}\right) \mid 6$, and since the product of more than four distinct integers cannot divide 6 , this implies $k \leq 4$. Similarly $l \leq 4$; hence $g(x)=0$ has at most 8 distinct integer solutions. Remark. The proposer provided a solution for the upper bound of 1995 roots which was essentially the same as that of (IMO74-6).


22. (USA 4) Real constants $a, b, c$ are such that there is exactly one square all of whose vertices lie on the cubic curve $y=x^{3}+a x^{2}+b x+c$. Prove that the square has sides of length $\sqrt[4]{72}$.

Solution: 22. Suppose w.l.o.g. that the center of the square is at the origin $O(0,0)$. We denote the curve $y=f(x)=x^{3}+a x^{2}+b x+c$ by $\gamma$ and the vertices of the square by $A, B, C, D$ in this order. At first, the symmetry with respect to the point $O$ maps $\gamma$ into the curve $\bar{\gamma}\left(y=f(-x)=x^{3}-a x^{2}+b x-c\right)$. Obviously $\bar{\gamma}$ also passes through $A, B, C, D$, and thus has four different intersection points with $\gamma$. Then $2 a x^{2}+2 c$ has at least four distinct solution, which implies $a=c=0$. Particularly, $\gamma$ passes through $O$ and intersects all quadrants, and hence $b<0$. Further, the curve $\gamma^{\prime}$, obtained by rotation of $\gamma$ around $O$ for $90^{\circ}$, has an equation $-x=f(y)$ and also contains the points $A, B, C, D$ and $O$. The intersection points $(x, y)$ of $\gamma \cap \gamma^{\prime}$ are determined by $-x=f(f(x))$, and hence they are roots of a polynomial $p(x)=f(f(x))+x$ of 9-th degree.  But the number of times that one cubic actually crosses the other in each quadrant is in the general case even (draw the picture!), and since $A B C D$ is the only square lying on $\gamma \cap \gamma^{\prime}$, the intersection points $A, B, C, D$ must be double. It follows that  $$ p(x)=x[(x-r)(x+r)(x-s)(x+s)]^{2}, $$  where $r, s$ are the $x$-coordinates of $A$ and $B$. On the other hand, $p(x)$ is defined by $\left(x^{3}+b x\right)^{3}+b\left(x^{3}+b x\right)+x$, and therefore equating of coefficients with (1) yields  $$ \begin{array}{cc} 3 b=-2\left(r^{2}+s^{2}\right), & 3 b^{2}=\left(r^{2}+s^{2}\right)^{2}+2 r^{2} s^{2}, \\ b\left(b^{2}+1\right)=-2 r^{2} s^{2}\left(r^{2}+s^{2}\right), & b^{2}+1=r^{4} s^{4} . \end{array} $$  Straightforward solving this system of equations gives $b=-\sqrt{8}$ and $r^{2}+$ $s^{2}=\sqrt{18}$. The line segment from $O$ to $(r, s)$ is half a diagonal of the square, and thus a side of the square has length $a=\sqrt{2\left(r^{2}+s^{2}\right)}=\sqrt[4]{72}$.


23. (IND 2) Let $f$ and $g$ be two integer-valued functions defined on the set of all integers such that (a) $f(m+f(f(n)))=-f(f(m+1)-n$ for all integers $m$ and $n$; (b) $g$ is a polynomial function with integer coefficients and $g(n)=g(f(n))$ for all integers $n$. Determine $f(1991)$ and the most general form of $g$.

Solution: 23. From (i), replacing $m$ by $f(f(m))$, we get  $$ f(f(f(m))+f(f(n)))=-f(f(f(f(m))+1))-n $$  analogously $\quad f(f(f(n))+f(f(m)))=-f(f(f(f(n))+1))-m$. From these relations we get $f(f(f(f(m))+1))-f(f(f(f(n))+1))=m-n$. Again from (i),  $$ \begin{aligned} & f(f(f(f(m))+1))=f(-m-f(f(2))) \\ & \text { and } \quad f(f(f(f(n))+1))=f(-n-f(f(2))) . \end{aligned} $$  Setting $f(f(2))=k$ we obtain $f(-m-k)-f(-n-k)=m-n$ for all integers $m, n$. This implies $f(m)=f(0)-m$. Then also $f(f(m))=m$, and using this in (i) we finally get  $$ f(n)=-n-1 \quad \text { for all integers } n $$  Particularly $f(1991)=-1992$. From (ii) we obtain $g(n)=g(-n-1)$ for all integers $n$. Since $g$ is a polynomial, it must also satisfy $g(x)=g(-x-1)$ for all real $x$. Let us now express $g$ as a polynomial on $x+1 / 2: g(x)=h(x+1 / 2)$. Then $h$ satisfies $h(x+1 / 2)=h(-x-1 / 2)$, i.e. $h(y)=h(-y)$, hence it is a polynomial in $y^{2}$; thus $g$ is a polynomial in $(x+1 / 2)^{2}=x^{2}+x+1 / 4$. Hence $g(n)=p\left(n^{2}+n\right)$ (for some polynomial $p$ ) is the most general form of $g$.


24. (IND 1) An odd integer $n \geq 3$ is said to be "nice" if there is at least one permutation $a_{1}, a_{2}, \ldots, a_{n}$ of $1,2, \ldots, n$ such that the $n$ sums $a_{1}-a_{2}+$ $a_{3}-\cdots-a_{n-1}+a_{n}, a_{2}-a_{3}+a_{4}-\cdots-a_{n}+a_{1}, a_{3}-a_{4}+a_{5}-\cdots-a_{1}+$ $a_{2}, \ldots, a_{n}-a_{1}+a_{2}-\cdots-a_{n-2}+a_{n-1}$ are all positive. Determine the set of all "nice" integers.

Solution: 24. Let $y_{k}=a_{k}-a_{k+1}+a_{k+2}-\cdots+a_{k+n-1}$ for $k=1,2, \ldots, n$, where we define $x_{i+n}=x_{i}$ for $1 \leq i \leq n$. We then have $y_{1}+y_{2}=2 a_{1}, y_{2}+y_{3}=$ $2 a_{2}, \ldots, y_{n}+y_{1}=2 a_{n}$. (i) Let $n=4 k-1$ for some integer $k>0$. Then for each $i=1,2, \ldots, n$ we have that $y_{i}=\left(a_{i}+a_{i+1}+\cdots+a_{i-1}\right)-2\left(a_{i+1}+a_{i+3}+\cdots+a_{i-2}\right)=1+$ $2+\cdots+(4 k-1)-2\left(a_{i+1}+a_{i+3}+\cdots+a_{i-2}\right)$ is even. Suppose now that $a_{1}, \ldots, a_{n}$ is a good permutation. Then each $y_{i}$ is positive and even, so $y_{i} \geq 2$. But for some $t \in\{1, \ldots, n\}$ we must have $a_{t}=1$, and thus $y_{t}+y_{t+1}=2 a_{t}=2$ which is impossible. Hence the numbers $n=4 k-1$ are not good. (ii) Let $n=4 k+1$ for some integer $k>0$. Then $2,4, \ldots, 4 k, 4 k+1,4 k-$ $1, \ldots, 3,1$ is a permutation with the desired property. Indeed, in this case $y_{1}=y_{4 k+1}=1, y_{2}=y_{4 k}=3, \ldots, y_{2 k}=y_{2 k+2}=4 k-1$, $y_{2 k+1}=4 k+1$. Therefore all nice numbers are given by $4 k+1, k \in \mathbb{N}$.


25. (USA 1) Suppose that $n \geq 2$ and $x_{1}, x_{2}, \ldots, x_{n}$ are real numbers between 0 and 1 (inclusive). Prove that for some index $i$ between 1 and $n-1$ the inequality  $$ x_{i}\left(1-x_{i+1}\right) \geq \frac{1}{4} x_{1}\left(1-x_{n}\right) $$  holds.

Solution: 25. Since replacing $x_{1}$ by 1 can only reduce the set of indices $i$ for which the desired inequality holds, we may assume $x_{1}=1$. Similarly we may assume $x_{n}=0$. Now we can let $i$ be the largest index such that $x_{i}>1 / 2$. Then $x_{i+1} \leq 1 / 2$, hence  $$ x_{i}\left(1-x_{i+1}\right) \geq \frac{1}{4}=\frac{1}{4} x_{1}\left(1-x_{n}\right) . $$


26. (CZS 1) Let $n \geq 2$ be a natural number and let the real numbers $p, a_{1}, a_{2}, \ldots, a_{n}, b_{1}, b_{2}, \ldots, b_{n}$ satisfy $1 / 2 \leq p \leq 1,0 \leq a_{i}, 0 \leq b_{i} \leq p$, $i=1, \ldots, n$, and $\sum_{i=1}^{n} a_{i}=\sum_{i=1}^{n} b_{i}=1$. Prove the inequality  $$ \sum_{i=1}^{n} b_{i} \prod_{\substack{j=1 \\ j \neq i}}^{n} a_{j} \leq \frac{p}{(n-1)^{n-1}} $$

Solution: 26. Without loss of generality we can assume $b_{1} \geq b_{2} \geq \cdots \geq b_{n}$. We denote by $A_{i}$ the product $a_{1} a_{2} \ldots a_{i-1} a_{i+1} \ldots a_{n}$. If for some $i<j$ holds $A_{i}<A_{j}$, then $b_{i} A_{i}+b_{j} A_{j} \leq b_{i} A_{j}+b_{j} A_{i}$ (or equivalently $\left(b_{i}-b_{j}\right)\left(A_{i}-A_{j}\right) \leq 0$ ). Therefore the sum $\sum_{i=1}^{n} b_{i} A_{i}$ does not decrease when we rearrange the numbers $a_{1}, \ldots, a_{n}$ so that $A_{1} \geq \cdots \geq A_{n}$, and consequently $a_{1} \leq \cdots \leq$ $a_{n}$. Further, for fixed $a_{i}$ 's and $\sum b_{i}=1$, the sum $\sum_{i=1}^{n} b_{i} A_{i}$ is maximal when $b_{1}$ takes the largest possible value, i.e. $b_{1}=p, b_{2}$ takes the remaining largest possible value $b_{2}=1-p$, whereas $b_{3}=\cdots=b_{n}=0$. In this case  $$ \begin{aligned} \sum_{i=1}^{n} b_{i} A_{i} & =p A_{1}+(1-p) A_{2}=a_{3} \ldots a_{n}\left(p a_{2}+(1-p) a_{1}\right) \\ & \leq p\left(a_{1}+a_{2}\right) a_{3} \ldots a_{n} \leq \frac{p}{(n-1)^{n-1}} \end{aligned} $$  using the inequality between the geometric and arithmetic means for $a_{3}, \ldots, a_{n}, a_{1}+a_{2}$.


27. (POL 2) Determine the maximum value of the sum  $$ \sum_{i<j} x_{i} x_{j}\left(x_{i}+x_{j}\right) $$  over all $n$-tuples $\left(x_{1}, \ldots, x_{n}\right)$, satisfying $x_{i} \geq 0$ and $\sum_{i=1}^{n} x_{i}=1$.

Solution: 27. Write $F\left(x_{1}, \ldots, x_{n}\right)=\sum_{i<j} x_{i} x_{j}\left(x_{i}+x_{j}\right)$. Choose an $n$-tuple $\left(x_{1}, \ldots, x_{n}\right)$, $\sum_{i=1}^{n} x_{i}=1, x_{i} \geq 0$ with at least three nonzero components, and assume w.l.o.g. that $x_{1} \geq \cdots \geq x_{k-1} \geq x_{k} \geq x_{k+1}=\cdots=x_{n}=0$. We claim that replacing $x_{k-1}, x_{k}$ with $x_{k-1}+x_{k}, 0$ the value of $F$ increases. Write for brevity $x_{k-1}=a, x_{k}=b$. Then  $$ \begin{gathered} F(\ldots, a+b, 0,0, \ldots)-F(\ldots, a, b, 0, \ldots) \\ =\sum_{i=1}^{k-2} x_{i}(a+b)\left(x_{i}+a+b\right)-\sum_{i=1}^{k-2}\left[x_{i} a\left(x_{i}+a\right)+x_{i} b\left(x_{i}+b\right)\right]-a b(a+b) \end{gathered} $$  $$ =a b\left(2 \sum_{i=1}^{k-2} x_{i}-a-b\right)=a b(2-3(a+b))>0 $$  because $x_{k-1}+x_{k} \leq \frac{2}{3}\left(x_{1}+x_{k-1}+x_{k-2}\right) \leq \frac{2}{3}$. Repeating this procedure we can reduce the number of nonzero $x_{i}$ 's to two, increasing the value of $F$ in each step. It remains to maximize $F$ over $n$-tuples $\left(x_{1}, x_{2}, 0, \ldots, 0\right)$ with $x_{1}, x_{2} \geq 0, x_{1}+x_{2}=1$ : in this case $F$ equals $x_{1} x_{2}$ and attains its maximum value $\frac{1}{4}$ when $x_{1}=x_{2}=\frac{1}{2}, x_{3}=\ldots, x_{n}=0$.


28. (NET 1) ${ }^{\mathrm{IMO}}$ Given a real number $a>1$, construct an infinite and bounded sequence $x_{0}, x_{1}, x_{2}, \ldots$ such that for all natural numbers $i$ and $j, i \neq j$, the following inequality holds:  $$ \left|x_{i}-x_{j}\right||i-j|^{a} \geq 1 $$

Solution: 28. Let $x_{n}=c(n \sqrt{2}-[n \sqrt{2}])$ for some constant $c>0$. For $i>j$, putting $p=[i \sqrt{2}]-[j \sqrt{2}]$, we have $\left|x_{i}-x_{j}\right|=c|(i-j) \sqrt{2}-p|=\frac{\left|2(i-j)^{2}-p^{2}\right| c}{(i-j) \sqrt{2}+p} \geq \frac{c}{(i-j) \sqrt{2}+p} \geq \frac{c}{4(i-j)}$, because $p<(i-j) \sqrt{2}+1$. Taking $c=4$, we obtain that for any $i>j$, $(i-j)\left|x_{i}-x_{j}\right| \geq 1$. Of course, this implies $(i-j)^{a}\left|x_{i}-x_{j}\right| \geq 1$ for any $a>1$ 。 Remark. The constant 4 can be replaced with $3 / 2+\sqrt{2}$. Second solution. Another example of a sequence $\left\{x_{n}\right\}$ is constructed in the following way: $x_{1}=0, x_{2}=1, x_{3}=2$ and $x_{3^{k} i+m}=x_{m}+\frac{i}{3^{k}}$ for $i=1,2$ and $1 \leq m \leq 3^{k}$. It is easily shown that $|i-j| \cdot\left|x_{i}-x_{j}\right| \geq 1 / 3$ for any $i \neq j$. Third solution. If $n=b_{0}+2 b_{1}+\cdots+2^{k} b_{k}, b_{i} \in\{0,1\}$, then one can set $x_{n}$ to be $=b_{0}+2^{-a} b_{1}+\cdots+2^{-k a} b_{k}$. In this case it holds that $|i-j|^{a}\left|x_{i}-x_{j}\right| \geq$ $\frac{2^{a}-2}{2^{a}-1}$.


29. (FIN 2) We call a set $S$ on the real line $\mathbb{R}$ superinvariant if for any stretching $A$ of the set by the transformation taking $x$ to $A(x)=x_{0}+$ $a\left(x-x_{0}\right)$ there exists a translation $B, B(x)=x+b$, such that the images of $S$ under $A$ and $B$ agree; i.e., for any $x \in S$ there is a $y \in S$ such that $A(x)=B(y)$ and for any $t \in S$ there is a $u \in S$ such that $B(t)=A(u)$. Determine all superinvariant sets. Remark. It is assumed that $a>0$.

Solution: 29. One easily observes that the following sets are super-invariant: one-point set, its complement, closed and open half-lines or their complements, and the whole real line. To show that these are the only possibilities, we first observe that $S$ is super-invariant if and only if for each $a>0$ there is a $b$ such that $x \in S \Leftrightarrow a x+b \in S$. (i) Suppose that for some $a$ there are two such $b$ 's: $b_{1}$ and $b_{2}$. Then $x \in$ $S \Leftrightarrow a x+b_{1} \in S$ and $x \in S \Leftrightarrow a x+b_{2} \in S$, which implies that $S$ is periodic: $y \in S \Leftrightarrow y+\frac{b_{1}-b_{2}}{a} \in S$. Since $S$ is identical to a translate of any stretching of $S$, all positive numbers are periods of $S$. Therefore $S \equiv \mathbb{R}$. (ii) Assume that, for each $a, b=f(a)$ is unique. Then for any $a_{1}$ and $a_{2}$,  $$ \begin{aligned} x \in S & \Leftrightarrow a_{1} x+f\left(a_{1}\right) \in S \Leftrightarrow a_{1} a_{2} x+a_{2} f\left(a_{1}\right)+f\left(a_{2}\right) \in S \\ & \Leftrightarrow a_{2} x+f\left(a_{2}\right) \in S \Leftrightarrow a_{1} a_{2} x+a_{1} f\left(a_{2}\right)+f\left(a_{1}\right) \in S . \end{aligned} $$  As above it follows that $a_{1} f\left(a_{2}\right)+f\left(a_{1}\right)=a_{2} f\left(a_{1}\right)+f\left(a_{2}\right)$, or equivalently $f\left(a_{1}\right)\left(a_{2}-1\right)=f\left(a_{2}\right)\left(a_{1}-1\right)$. Hence (for some $\left.c\right), f(a)=c(a-1)$ for all $a$. Now $x \in S \Leftrightarrow a x+c(a-1) \in S$ actually means that $y-c \in S \Leftrightarrow a y-c \in S$ for all $a$. Then it is easy to conclude that $\{y-c \mid y \in S\}$ is either a half-line or the whole line, and so is $S$.


3. (PRK 1) Let $S$ be any point on the circumscribed circle of $\triangle P Q R$. Then the feet of the perpendiculars from $S$ to the three sides of the triangle lie on the same straight line. Denote this line by $l(S, P Q R)$. Suppose that the hexagon $A B C D E F$ is inscribed in a circle. Show that the four lines $l(A, B D F), l(B, A C E), l(D, A B F)$, and $l(E, A B C)$ intersect at one point if and only if $C D E F$ is a rectangle.

Solution: 3. Consider the problem with the unit circle on the complex plane. For convenience, we use the same letter for a point in the plane and its corresponding complex number. Lemma 1. Line $l(S, P Q R)$ contains the point $Z=\frac{P+Q+R+S}{2}$.  Proof. Suppose $P^{\prime}, Q^{\prime}, R^{\prime}$ are the feet of perpendiculars from $S$ to $Q R$, $R P, P Q$ respectively. It suffices to show that $P^{\prime}, Q^{\prime}, R^{\prime}, Z$ are on the same line. Let us first represent $P^{\prime}$ by $Q, R, S$. Since $P^{\prime} \in Q R$, we have $\frac{P^{\prime}-Q}{R-Q}=\overline{\left(\frac{P^{\prime}-Q}{R-Q}\right)}$, that is,  $$ \left(P^{\prime}-Q\right)(\bar{R}-\bar{Q})=\left(\overline{P^{\prime}}-\bar{Q}\right)(R-Q) $$  On the other hand, since $S P^{\prime} \perp Q R$, the ratio $\frac{P^{\prime}-S}{R-Q}$ is purely imaginary. Thus  $$ \left(P^{\prime}-S\right)(\bar{R}-\bar{Q})=-\left(\overline{P^{\prime}}-\bar{S}\right)(R-Q) $$  Eliminating $\overline{P^{\prime}}$ from (1) and (2) and using the fact that $\bar{X}=X^{-1}$ for $X$ on the unit circle, we obtain $P^{\prime}=(Q+R+S-Q R / S) / 2$ and analogously $Q^{\prime}=(P+R+S-P R / S) / 2$ and $R^{\prime}=(P+Q+S-$ $P Q / S) / 2$. Hence $Z-P^{\prime}=(P+Q R / S) / 2, Z-Q^{\prime}=(Q+P R / S) / 2$ and $Z-R^{\prime}=(R+P Q / S) / 2$. Setting $P=p^{2}, Q=q^{2}, R=r^{2}$, $S=s^{2}$ we obtain $Z-P^{\prime}=\frac{p q r}{2 s}\left(\frac{p s}{q r}+\frac{q r}{p s}\right), Z-Q^{\prime}=\frac{p q r}{2 s}\left(\frac{q s}{p r}+\frac{p r}{q s}\right)$ and $Z-P^{\prime}=\frac{p q r}{2 s}\left(\frac{r s}{p q}+\frac{p q}{r s}\right)$. Since $x+x^{-1}=2 \operatorname{Re} x$ is real for all $x$ on the unit circle, it follows that the ratio of every pair of these differences is real, which means that $Z, P^{\prime}, Q^{\prime}, R^{\prime}$ belong to the same line. Lemma 2. If $P, Q, R, S$ are four different points on a circle, then the lines $l(P, Q R S), l(Q, R S P), l(R, S P Q), l(S, P Q R)$ intersect at one point. Proof. By Lemma 1, they all pass through $\frac{P+Q+R+S}{2}$. Now we can find the needed conditions for $A, B, \ldots, F$. In fact, the lines $l(A, B D F), l(D, A B F)$ meet at $Z_{1}=\frac{A+B+D+F}{2}$, and $l(B, A C E)$, $l(E, A B C)$ meet at $Z_{2}=\frac{A+B+C+E}{2}$. Hence, $Z_{1} \equiv Z_{2}$ if and only if $D-C=E-F \Leftrightarrow C D E F$ is a rectangle. Remark. The line $l(S, P Q R)$ is widely known as Simson line; the proof that the feet of perpendiculars are collinear is straightforward. The key claim, Lemma 1, is a known property of Simson lines, and can be shown elementarily:  * $l(S, P Q R)$ passes through the midpoint $X$ of $H S$, where $H$ is the orthocenter of $P Q R$.


30. (BUL 3) Two students $A$ and $B$ are playing the following game: Each of them writes down on a sheet of paper a positive integer and gives the sheet to the referee. The referee writes down on a blackboard two integers, one of which is the sum of the integers written by the players. After that, the referee asks student $A$ : "Can you tell the integer written by the other student?" If $A$ answers "no," the referee puts the same question to student $B$. If $B$ answers "no," the referee puts the question back to $A$, and so on. Assume that both students are intelligent and truthful. Prove that after a finite number of questions, one of the students will answer "yes."

Solution: 30. Let $a$ and $b$ be the integers written by $A$ and $B$ respectively, and let $x<y$ be the two integers written by the referee. Suppose that none of $A$ and $B$ ever answers "yes". Initially, regardless of $a, A$ knows that $0 \leq b \leq y$ and answers "no". In the second step, $B$ knows that $A$ obtained $0 \leq b \leq y$, but if $a$ were greater than $x, A$ would know that $a+b=y$ and would thus answer "yes". So $B$ concludes $0 \leq a \leq x$ but answers "no". The process continues. Suppose that, in the $n$-th step, $A$ knows that $B$ obtained $r_{n-1} \leq a \leq s_{n-1}$. If $b>x-r_{n-1}, B$ would know that $a+b>x$ and hence $a+b=y$, while if $b<y-s_{n-1}, B$ would know that $a+b<y$, i.e. $a+b=x$ : in both cases he would be able to guess $a$. However, $B$ answered "no", from which $A$ concludes $y-s_{n-1} \leq b \leq x-r_{n-1}$. Put $r_{n}=y-s_{n-1}$ and $s_{n}=x-r_{n-1}$. Similarly, in the next step $B$ knows that $A$ obtained $r_{n} \leq b \leq s_{n}$ and, since $A$ answered "no", concludes $y-s_{n} \leq a \leq x-r_{n}$. Put $r_{n+1}=y-s_{n}$ and $s_{n+1}=x-r_{n}$. Notice that in both cases $s_{i+1}-r_{i+1}=s_{i}-r_{i}-(y-x)$. Since $y-x>0$, there exists an $m$ for which $s_{m}-r_{m}<0$, a contradiction.


4. (FRA 2) ${ }^{\mathrm{IMO5}}$ Let $A B C$ be a triangle and $M$ an interior point in $A B C$. Show that at least one of the angles $\measuredangle M A B, \measuredangle M B C$, and $\measuredangle M C A$ is less than or equal to $30^{\circ}$.

Solution: 4. Assume the contrary, that $\angle M A B, \angle M B C, \angle M C A$ are all greater than $30^{\circ}$. By the sine Ceva theorem, it holds that  $$ \begin{aligned} & \sin \angle M A C \sin \angle M B A \sin \angle M C B \\ = & \sin \angle M A B \sin \angle M B C \sin \angle M C A>\sin ^{3} 30^{\circ}=\frac{1}{8} . \end{aligned} $$  On the other hand, since $\angle M A C+\angle M B A+\angle M C B<180^{\circ}-3 \cdot 30^{\circ}=90^{\circ}$, Jensen's inequality applied on the concave function $\ln \sin x(x \in[0, \pi])$ gives us $\sin \angle M A C \sin \angle M B A \sin \angle M C B<\sin ^{3} 30^{\circ}$, contradicting (*).  Second solution. Denote the intersections of $P A, P B, P C$ with $B C, C A$, $A B$ by $A_{1}, B_{1}, C_{1}$, respectively. Suppose that each of the angles $\angle P A B$, $\angle P B C, \angle P C A$ is greater than $30^{\circ}$ and denote $P A=2 x, P B=2 y, P C=$ $2 z$. Then $P C_{1}>x, P A_{1}>y, P B_{1}>z$. On the other hand, we know that  $$ \frac{P C_{1}}{P C+P C_{1}}+\frac{P A_{1}}{P A+P A_{1}}+\frac{P B_{1}}{P B+P B_{1}}=\frac{S_{A B P}}{S_{A B C}}+\frac{S_{P B C}}{S_{A B C}}+\frac{S_{A P C}}{S_{A B C}}=1 . $$  Since the function $\frac{t}{p+t}$ is increasing, we obtain $\frac{x}{2 z+x}+\frac{y}{2 x+y}+\frac{z}{2 y+z}<1$. But on the contrary, Cauchy-Schwartz inequality (or alternatively Jensen's inequality) yields  $$ \frac{x}{2 z+x}+\frac{y}{2 x+y}+\frac{z}{2 y+z} \geq \frac{(x+y+z)^{2}}{x(2 z+x)+y(2 x+y)+z(2 y+z)}=1 . $$