olympiads-ref / BalticWay /md /en-bw15sol.md
beichen0426's picture
Duplicate from AI-MO/olympiads-ref
63c5bce verified

BALTIC WAY 2015

Problems and Solutions

Problem 1.

For $n \geq 2$, an equilateral triangle is divided into $n^{2}$ congruent smaller equilateral triangles. Determine all ways in which real numbers can be assigned to the $\frac{(n+1)(n+2)}{2}$ vertices so that three such numbers sum to zero whenever the three vertices form a triangle with edges parallel to the sides of the big triangle.

Solution. We label the vertices (and the corresponding real numbers) as follows.

For $n=2$, we see that

a2+a4+a5=0=a2+a3+a5 a_{2}+a_{4}+a_{5}=0=a_{2}+a_{3}+a_{5}

which shows that $a_{3}=a_{4}$ and similarly $a_{1}=a_{5}$ and $a_{2}=a_{6}$. Now the only additional requirement is $a_{1}+a_{2}+a_{3}=0$, so that all solutions are of the following form, for any $x, y$ and $z$ with $x+y+z=0$ :

For $n=3$, observe that $a_{1}=a_{7}=a_{10}$ since they all equal $a_{5}$. Since also $a_{1}+a_{7}+a_{10}=0$, they all equal zero. By considering the top triangle, we get $x=a_{2}=-a_{3}$ and this uniquely determines the rest. It is easily checked that, for any real $x$, this is actually a solution:

For $n \geq 3$ we can apply the same argument as above for any collection of 10 vertices. Any vertex not on the sides of the big triangle has to equal zero, since it is the centre of such a collection of 10 vertices. Any vertex $a$ on the sides of the big triangle forms some parallelogram similar to $a_{4}, a_{2}, a_{5}, a_{8}$, where the point opposite $a$ is in the interior of the big triangle. Since such opposite numbers are equal, all $a_{i}$ have to be zero in this case.

Problem 2.

Let $n$ be a positive integer and let $a_{1}, \ldots, a_{n}$ be real numbers satisfying $0 \leq a_{i} \leq 1$ for $i=1, \ldots, n$. Prove the inequality

(1a1n)(1a2n)(1ann)(1a1a2an)n. \left(1-a_{1}^{n}\right)\left(1-a_{2}^{n}\right) \cdots\left(1-a_{n}^{n}\right) \leq\left(1-a_{1} a_{2} \cdots a_{n}\right)^{n} .

Solution. The numbers $1-a_{i}^{n}$ are positive by assumption. AM-GM gives

(1a1n)(1a2n)(1ann)((1a1n)+(1a2n)++(1ann)n)n=(1a1n++annn)n. \begin{aligned} \left(1-a_{1}^{n}\right)\left(1-a_{2}^{n}\right) \cdots\left(1-a_{n}^{n}\right) & \leq\left(\frac{\left(1-a_{1}^{n}\right)+\left(1-a_{2}^{n}\right)+\cdots+\left(1-a_{n}^{n}\right)}{n}\right)^{n} \\ & =\left(1-\frac{a_{1}^{n}+\cdots+a_{n}^{n}}{n}\right)^{n} . \end{aligned}

By applying AM-GM again we obtain

a1a2ana1n++annn(1a1n++annn)n(1a1a2an)n a_{1} a_{2} \cdots a_{n} \leq \frac{a_{1}^{n}+\cdots+a_{n}^{n}}{n} \Rightarrow\left(1-\frac{a_{1}^{n}+\cdots+a_{n}^{n}}{n}\right)^{n} \leq\left(1-a_{1} a_{2} \cdots a_{n}\right)^{n}

and hence the desired inequality.

Remark. It is possible to use Jensen's inequality applied to $f(x)=\log \left(1-e^{x}\right)$.

Problem 3.

Let $n>1$ be an integer. Find all non-constant real polynomials $P(x)$ satisfying, for any real $x$, the identity

P(x)P(x2)P(x3)P(xn)=P(xn(n+1)2). P(x) P\left(x^{2}\right) P\left(x^{3}\right) \cdots P\left(x^{n}\right)=P\left(x^{\frac{n(n+1)}{2}}\right) .

Solution. Answer: $P(x)=x^{m}$ if $n$ is even; $P(x)= \pm x^{m}$ if $n$ is odd.

Consider first the case of a monomial $P(x)=a x^{m}$ with $a \neq 0$. Then

axmn(n+1)2=P(xn(n+1)2)=P(x)P(x2)P(x3)P(xn)=axmax2maxnm=anxmn(n+1)2 a x^{\frac{m n(n+1)}{2}}=P\left(x^{\frac{n(n+1)}{2}}\right)=P(x) P\left(x^{2}\right) P\left(x^{3}\right) \cdots P\left(x^{n}\right)=a x^{m} \cdot a x^{2 m} \cdots a x^{n m}=a^{n} x^{\frac{m n(n+1)}{2}}

implies $a^{n}=a$. Thus, $a=1$ when $n$ is even and $a= \pm 1$ when $n$ is odd. Obviously these polynomials satisfy the desired equality.

Suppose now that $P$ is not a monomial. Write $P(x)=a x^{m}+Q(x)$, where $Q$ is non-zero polynomial with $\operatorname{deg} Q=k<m$. We have

axmn(n+1)2+Q(xn(n+1)2)=P(xn(n+1)2)=P(x)P(x2)P(x3)P(xn)=(axm+Q(x))(ax2m+Q(x2))(axnm+Q(xn)). \begin{aligned} a x^{\frac{m n(n+1)}{2}}+Q & \left(x^{\frac{n(n+1)}{2}}\right)=P\left(x^{\frac{n(n+1)}{2}}\right) \\ & =P(x) P\left(x^{2}\right) P\left(x^{3}\right) \cdots P\left(x^{n}\right)=\left(a x^{m}+Q(x)\right)\left(a x^{2 m}+Q\left(x^{2}\right)\right) \cdots\left(a x^{n m}+Q\left(x^{n}\right)\right) . \end{aligned}

The highest degree of a monomial, on both sides of the equality, is $\frac{m n(n+1)}{2}$. The second highest degree in the right-hand side is

2m+3m++nm+k=m(n+2)(n1)2+k 2 m+3 m+\cdots+n m+k=\frac{m(n+2)(n-1)}{2}+k

while in the left-hand side it is $\frac{k n(n+1)}{2}$. Thus

m(n+2)(n1)2+k=kn(n+1)2 \frac{m(n+2)(n-1)}{2}+k=\frac{k n(n+1)}{2}

which leads to

(mk)(n+2)(n1)=0 (m-k)(n+2)(n-1)=0

and so $m=k$, contradicting the assumption that $m>k$. Consequently, no polynomial of the form $a x^{m}+Q(x)$ fulfils the given condition.

Problem 4.

A family wears clothes of three colours: red, blue and green, with a separate, identical laundry bin for each colour. At the beginning of the first week, all bins are empty. Each week, the family generates a total of $10 \mathrm{~kg}$ of laundry (the proportion of each colour is subject to variation). The laundry is sorted by colour and placed in the bins. Next, the heaviest bin (only one of them, if there are several that are heaviest) is emptied and its contents washed. What is the minimal possible storing capacity required of the laundry bins in order for them never to overflow?

Solution. Answer: $25 \mathrm{~kg}$.

Each week, the accumulation of laundry increases the total amount by $K=10$, after which the washing decreases it by at least one third, because, by the pigeon-hole principle, the bin with the most laundry must contain at least a third of the total. Hence the amount of laundry post-wash after the $n$th week is bounded above by the sequence $a_{n+1}=\frac{2}{3}\left(a_{n}+K\right)$ with $a_{0}=0$, which is clearly bounded above by $2 K$. The total amount of laundry is less than $2 K$ post-wash and $3 K$ pre-wash.

Now suppose pre-wash state $(a, b, c)$ precedes post-wash state $(a, b, 0)$, which precedes pre-wash state $\left(a^{\prime}, b^{\prime}, c^{\prime}\right)$. The relations $a \leq c$ and $a^{\prime} \leq a+K$ lead to

3K>a+b+c2a2(aK) 3 K>a+b+c \geq 2 a \geq 2\left(a^{\prime}-K\right)

and similarly for $b^{\prime}$, whence $a^{\prime}, b^{\prime}<\frac{5}{2} K$. Since also $c^{\prime} \leq K$, a pre-wash bin, and a fortiori a post-wash bin, always contains less than $\frac{5}{2} K$.

Consider now the following scenario. For a start, we keep packing the three bins equally full before washing. Initialising at $(0,0,0)$, the first week will end at $\left(\frac{1}{3} K, \frac{1}{3} K, \frac{1}{3} K\right)$ pre-wash and $\left(\frac{1}{3} K, \frac{1}{3} K, 0\right)$ post-wash, the second week at $\left(\frac{5}{9} K, \frac{5}{9} K, \frac{5}{9} K\right)$ pre-wash and $\left(\frac{5}{9} K, \frac{5}{9} K, 0\right)$ post-wash, &c. Following this scheme, we can get arbitrarily close to the state $(K, K, 0)$ after washing. Supposing this accomplished, placing $\frac{1}{2} K \mathrm{kg}$ of laundry in each of the non-empty bins leaves us in a state close to $\left(\frac{3}{2} K, \frac{3}{2} K, 0\right)$ pre-wash and $\left(\frac{3}{2} K, 0,0\right)$ post-wash. Finally, the next week's worth of laundry is directed solely to the single non-empty bin. It may thus contain any amount of laundry below $\frac{5}{2} K \mathrm{kg}$.

Problem 5.

Find all functions $f: \mathbf{R} \rightarrow \mathbf{R}$ satisfying the equation

xf(y)+yf(x)=f(xy)+f(x2)+f(f(y)) |x| f(y)+y f(x)=f(x y)+f\left(x^{2}\right)+f(f(y))

for all real numbers $x$ and $y$.

Solution. Answer: all functions $f(x)=c(|x|-x)$, where $c \geq 0$.

Choosing $x=y=0$, we find

f(f(0))=2f(0) f(f(0))=-2 f(0)

Denote $a=f(0)$, so that $f(a)=-2 a$, and choose $y=0$ in the initial equation:

ax=a+f(x2)+f(a)=a+f(x2)2af(x2)=a(x+1) a|x|=a+f\left(x^{2}\right)+f(a)=a+f\left(x^{2}\right)-2 a \quad \Rightarrow \quad f\left(x^{2}\right)=a(|x|+1)

In particular, $f(1)=2 a$. Choose $(x, y)=\left(z^{2}, 1\right)$ in the initial equation:

z2f(1)+f(z2)=f(z2)+f(z4)+f(f(1))2az2=z2f(1)=f(z4)+f(f(1))=a(z2+1)+f(2a)az2=a+f(2a) \begin{aligned} & z^{2} f(1)+f\left(z^{2}\right)=f\left(z^{2}\right)+f\left(z^{4}\right)+f(f(1)) \\ \Rightarrow & 2 a z^{2}=z^{2} f(1)=f\left(z^{4}\right)+f(f(1))=a\left(z^{2}+1\right)+f(2 a) \\ \Rightarrow & a z^{2}=a+f(2 a) \end{aligned}

The right-hand side is constant, while the left-hand side is a quadratic function in $z$, which can only happen if $a=0$. (Choose $z=1$ and then $z=0$.)

We now conclude that $f\left(x^{2}\right)=0$, and so $f(x)=0$ for all non-negative $x$. In particular, $f(0)=0$. Choosing $x=0$ in the initial equation, we find $f(f(y))=0$ for all $y$. Simplifying the original equation and swapping $x$ and $y$ leads to

xf(y)+yf(x)=f(xy)=yf(x)+xf(y). |x| f(y)+y f(x)=f(x y)=|y| f(x)+x f(y) .

Choose $y=-1$ and put $c=\frac{f(-1)}{2}$ :

xf(1)f(x)=f(x)+xf(1)f(x)=f(1)2(xx)=c(xx) |x| f(-1)-f(x)=f(x)+x f(-1) \Rightarrow f(x)=\frac{f(-1)}{2}(|x|-x)=c(|x|-x) \text {. }

One easily verifies that these functions satisfy the functional equation for any parameter $c \geq 0$.

Problem 6.

Two players take alternate turns in the following game. At the outset there are two piles, containing 10,000 and 20,000 tokens, respectively. A move consists of removing any positive number of tokens from a single pile or removing $x>0$ tokens from one pile and $y>0$ tokens from the other, where $x+y$ is divisible by 2015. The player who cannot make a move loses. Which player has a winning strategy?

Solution. The first player wins.

He should present his opponent with one of the following positions:

(0,0),(1,1),(2,2),,(2014,2014). (0,0), \quad(1,1), \quad(2,2), \quad \ldots, \quad(2014,2014) .

All these positions have different total numbers of tokens modulo 2015. Therefore, if the game starts from two piles of arbitrary sizes, it is possible to obtain one of these positions just by the first move. In our case

10,000+20,00017902015, 10,000+20,000 \equiv 1790 \bmod 2015,

and the first player can leave to his opponent the position $(895,895)$.

Now the second type of move can no longer be carried out. If the second player removes $n$ tokens from one pile, the first player may always respond be removing $n$ tokens from the other pile.

Problem 7.

There are 100 members in a ladies' club. Each lady has had tea (in private) with exactly 56 of the other members of the club. The Board, consisting of the 50 most distinguished ladies, have all had tea with one another. Prove that the entire club may be split into two groups in such a way that, within each group, any lady has had tea with any other.

Solution. Each lady in the Board has had tea with 49 ladies within the Board, and 7 ladies without. Each lady not in the Board has had tea with at most 49 ladies not in the Board, and at least 7 ladies in the Board. Comparing these two observations, we conclude that each lady not in the Board has had tea with exactly 49 ladies not in the Board and exactly 7 ladies in the Board. Hence the club may be split into Board members and non-members.

Problem 8.

With inspiration drawn from the rectilinear network of streets in New York, the Manhattan distance between two points $(a, b)$ and $(c, d)$ in the plane is defined to be

ac+bd |a-c|+|b-d| \text {. }

Suppose only two distinct Manhattan distances occur between all pairs of distinct points of some point set. What is the maximal number of points in such a set?

Solution. Answer: nine.

Let

{(x1,y1),,(xm,ym)}, where x1xm \left\{\left(x_{1}, y_{1}\right), \ldots,\left(x_{m}, y_{m}\right)\right\}, \quad \text { where } \quad x_{1} \leq \cdots \leq x_{m}

be the set, and suppose $m \geq 10$.

A special case of the Erdős-Szekeres Theorem asserts that a real sequence of length $n^{2}+1$ contains a monotonic subsequence of length $n+1$. (Proof: Given a sequence $a_{1} \ldots, a_{n^{2}+1}$, let $p_{i}$ denote the length of the longest increasing subsequence ending with $a_{i}$, and $q_{i}$ the length of the longest decreasing subsequence ending with $a_{i}$. If $i<j$ and $a_{i} \leq a_{j}$, then $p_{i}<p_{j}$. If $a_{i} \geq a_{j}$, then $q_{i}<q_{j}$. Hence all $n^{2}+1$ pairs $\left(p_{i}, q_{i}\right)$ are distinct. If all of them were to satisfy $1 \leq p_{i}, q_{i} \leq n$, it would violate the Pigeon-Hole Principle.)

Applied to the sequence $y_{1}, \ldots, y_{m}$, this will produce a subsequence

yiyjykyl or yiyjykyl y_{i} \leq y_{j} \leq y_{k} \leq y_{l} \quad \text { or } \quad y_{i} \geq y_{j} \geq y_{k} \geq y_{l}

One of the shortest paths from $\left(x_{i}, y_{i}\right)$ to $\left(x_{l}, y_{l}\right)$ will pass through first $\left(x_{j}, y_{j}\right)$ and then $\left(x_{k}, y_{k}\right)$. At least three distinct Manhattan distances will occur.

Conversely, among the nine points

(0,0),(±1,±1),(±2,0),(0,±2), (0,0), \quad( \pm 1, \pm 1), \quad( \pm 2,0), \quad(0, \pm 2),

only the Manhattan distances 2 and 4 occur.

Problem 9.

Let $n>2$ be an integer. A deck contains $\frac{n(n-1)}{2}$ cards, numbered

1,2,3,,n(n1)2 1,2,3, \ldots, \frac{n(n-1)}{2}

Two cards form a magic pair if their numbers are consecutive, or if their numbers are 1 and $\frac{n(n-1)}{2}$.

For which $n$ is it possible to distribute the cards into $n$ stacks in such a manner that, among the cards in any two stacks, there is exactly one magic pair?

Solution 1. Answer: for all odd $n$.

First assume a stack contains two cards that form a magic pair; say cards number $i$ and $i+1$. Among the cards in this stack and the stack with card number $i+2$ (they might be identical), there are two magic pairs - a contradiction. Hence no stack contains a magic pair.

Each card forms a magic pair with exactly two other cards. Hence if $n$ is even, each stack must contain at least $\left\lceil\frac{n-1}{2}\right\rceil=\frac{n}{2}$ cards, since there are $n-1$ other stacks. But then we need at least $n \frac{n}{2}>\frac{n(n-1)}{2}$ cards - a contradiction.

In the odd case we distribute the cards like this: Let $a_{1}, a_{2}, \ldots, a_{n}$ be the $n$ stacks and let $n=2 m+1$. Card number 1 is put into stack $a_{1}$. If card number $k m+i$, for $i=1,2, \ldots, m$, is put into stack $a_{j}$, then card number $k m+i+1$ is put into stack number $a_{j+i}$, where the indices are calculated modulo $n$.

There are

n(n1)2=(2m+1)(2m)2=m(2m+1) \frac{n(n-1)}{2}=\frac{(2 m+1)(2 m)}{2}=m(2 m+1)

cards. If we look at all the card numbers of the form $k m+1$, there are exactly $n=2 m+1$ of these, and we claim that there is exactly one in each stack. Card number 1 is in stack $a_{1}$, and card number $k m+1$ is in stack

a1+k(1+2+3++m) a_{1+k(1+2+3+\cdots+m)}

Since

1+2+3++m=m(m+1)2 1+2+3+\cdots+m=\frac{m(m+1)}{2}

and $\operatorname{gcd}\left(2 m+1, \frac{m(m+1)}{2}\right)=1$, all the indices

1+k(1+2+3++m),k=0,1,2,,2m 1+k(1+2+3+\cdots+m), \quad k=0,1,2, \ldots, 2 m

are different modulo $n=2 m+1$. In the same way we see that each stack contains exactly one of the $2 m+1$ cards with the numbers $k m+i$ for a given $i=2,3, \ldots, m$.

Now look at two different stacks $a_{v}$ and $a_{u}$. Then, without loss of generality, we may assume that $u=v+i$ for some $i=1,2, \ldots, m$ (again we consider the index modulo $n=2 m+1$ ). Since there is a card in stack $a_{v}$ with number $k m+i$, the card $k m+i+1$ is in stack $a_{v+i}=a_{u}$. Hence among the cards in any two stacks there is at least one magic pair. Since there is the same number of pairs of stacks as of magic pairs, there must be exactly one magic pair among the cards of any two stacks.

Solution 2 (found by Saint Petersburg). For the case of $n$ odd, consider the complete graph on the vertices $1, \ldots, n$ with $\frac{n(n-1)}{2}$ edges. The degree of each vertex is $n-1$, which is even, hence an Euler cycle $v_{1} v_{2} \cdots v_{\frac{n(n-1)}{2}} v_{1}$ exists. Place card number $i$ into stack number $v_{i}$. The magic pairs correspond to edges in the cycle.

Problem 10.

A subset $S$ of ${1,2, \ldots, n}$ is called balanced if for every $a \in S$ there exists some $b \in S, b \neq a$, such that $\frac{a+b}{2} \in S$ as well.

(a) Let $k>1$ be an integer and let $n=2^{k}$. Show that every subset $S$ of ${1,2, \ldots, n}$ with $|S|>\frac{3 n}{4}$ is balanced.

(b) Does there exist an $n=2^{k}$, with $k>1$ an integer, for which every subset $S$ of ${1,2, \ldots, n}$ with $|S|>\frac{2 n}{3}$ is balanced?

Solution of part (a). Let $m=n-|S|$, thus $m<\frac{n}{4}$ and (as $n$ is a multiple of 4 ) $m \leq \frac{n}{4}-1$. Let $a \in S$. There are $\frac{n}{2}-1$ elements in ${1,2, \ldots, n}$ distinct from $a$ and with the same parity as $a$. At most $m$ of those elements are not in $S$, hence at least $\frac{n}{2}-1-m \geq \frac{n}{4}$ of them are in $S$. For each such $b$, the number $\frac{a+b}{2}$ is an integer, and all of these at least $\frac{n}{4}$ numbers are distinct. But at most $m<\frac{n}{4}$ of them are not in $S$, so at least one is a member of $S$. Hence $S$ is balanced.

Solution 1 of part (b). For convenience we work with ${0,1, \ldots, n-1}$ rather than ${1,2, \ldots, n}$; this does not change the problem. We show that one can always find an unbalanced subset containing more than $\frac{2 n}{3}$ elements.

Let $\operatorname{ord}_{2}(i)$ denote the number of factors 2 occurring in the prime factorisation of $i$. We set

Tj={i{1,2,,n1}ord2(i)=j} T_{j}=\left\{i \in\{1,2, \ldots, n-1\} \mid \operatorname{ord}_{2}(i)=j\right\}

Then we choose

S={0,1,2,,n1}\(T1T3Tl), where l={k1 if k even k2 if k odd.  S=\{0,1,2, \ldots, n-1\} \backslash\left(T_{1} \cup T_{3} \cup \cdots \cup T_{l}\right), \quad \text { where } l= \begin{cases}k-1 & \text { if } k \text { even } \\ k-2 & \text { if } k \text { odd. }\end{cases}

Observe that $\left|T_{j}\right|=\frac{n}{2^{j+1}}$, so

S=n(n4+n16++n2l+1)=nn1412l+3114>nn3=2n3. |S|=n-\left(\frac{n}{4}+\frac{n}{16}+\cdots+\frac{n}{2^{l+1}}\right)=n-n \cdot \frac{\frac{1}{4}-\frac{1}{2^{l+3}}}{1-\frac{1}{4}}>n-\frac{n}{3}=\frac{2 n}{3} .

We show that $S$ is not balanced. Take $a=0 \in S$, and consider a $0 \neq b \in S$. If $b$ is odd, then $\frac{0+b}{2}$ is not integral. If $b$ is even, then $b \in T_{2} \cup T_{4} \cup \cdots$, so $\frac{b}{2} \in T_{1} \cup T_{3} \cup \cdots$, hence $\frac{b}{2} \notin S$. Thus $S$ is not balanced.

Solution 2 of part (b). We define the sets

Aj={2j1+1,2j1+2,,2j} A_{j}=\left\{2^{j-1}+1,2^{j-1}+2, \ldots, 2^{j}\right\}

and set

S=AkAk2Al{1}, where l={2 if k even ,1 if k odd.  S=A_{k} \cup A_{k-2} \cup \cdots \cup A_{l} \cup\{1\}, \quad \text { where } l= \begin{cases}2 & \text { if } k \text { even }, \\ 1 & \text { if } k \text { odd. }\end{cases}

Note that $A_{j} \subseteq{1,2, \ldots, n}$ whenever $j \leq k$, and that $\left|A_{j}\right|=2^{j-1}$. We find

S=2k1+2k3++2l1+1=2l12k+114+1=2l13+2n3+1>2n3. |S|=2^{k-1}+2^{k-3}+\cdots+2^{l-1}+1=\frac{2^{l-1}-2^{k+1}}{1-4}+1=-\frac{2^{l-1}}{3}+\frac{2 n}{3}+1>\frac{2 n}{3} .

We show that $S$ is not balanced. Take $a=1 \in S$, and consider a $1 \neq b \in S$. Then $b \in A_{j}$ for some $j$. If $b$ is even, then $\frac{1+b}{2}$ is not integral. If $b$ is odd, then also $1+b \in A_{j}$, so $\frac{1+b}{2} \in A_{j-1}$ and does not lie in $S$. Thus $S$ is not balanced.

Solution 3 of part (b). Let us introduce the concept of lonely element as an $a \in S$ for which there does not exist a $b \in S$, distinct from $a$, such that $\frac{a+b}{2} \in S$.

We will construct an unbalanced set $S$ with $|S|>\frac{2 n}{3}$ for all $k$. For $n=4$ we can use $S={1,2,4}$ (all elements are lonely), and for $n=8$ we can use $S={1,2,3,5,6,7}$ (2 and 6 are lonely).

We now construct an unbalanced set $S \subseteq{1,2, \ldots, 4 n}$, given an unbalanced set $T \subseteq{1,2, \ldots, n}$ with $|T|>\frac{2 n}{3}$. Take

S={i{1,2,,4n}i12}{4t2tT} S=\{i \in\{1,2, \ldots, 4 n\} \mid i \equiv 1 \bmod 2\} \cup\{4 t-2 \mid t \in T\}

Then

S=2n+T>2n+2n3=8n3=24n3. |S|=2 n+|T|>2 n+\frac{2 n}{3}=\frac{8 n}{3}=\frac{2 \cdot 4 n}{3} .

Figure 1: Problem 11.

Supposing $a \in T$ is lonely, we will show that $4 a-2 \in S$ is lonely. Indeed, suppose $4 a-2 \neq b \in S$ with

4a2+b2=2a1+b2S. \frac{4 a-2+b}{2}=2 a-1+\frac{b}{2} \in S .

Then $b$ must be even, so $b=4 t-2$ for some $a \neq t \in T$. But then

4a2+4t22=4a+t22 \frac{4 a-2+4 t-2}{2}=4 \frac{a+t}{2}-2

again an even element. However, as $a$ is lonely we know that $\frac{a+t}{2} \notin T$, and hence $4 \frac{a+t}{2}-2 \notin S$. We conclude that $4 a-2$ is lonely in $S$.

Thus $S$ is an unbalanced set, and by induction we can find an unbalanced set of size exceeding $\frac{2 n}{3}$ for all $k>1$.

Problem 11.

The diagonals of the parallelogram $A B C D$ intersect at $E$. The bisectors of $\angle D A E$ and $\angle E B C$ intersect at $F$. Assume that $E C F D$ is a parallelogram. Determine the ratio $A B: A D$.

Solution. Since $E C F D$ is a parallelogram, we have $E D | C F$ and $\angle C F B=\angle E B F=\angle F B C(B F$ bisects $\angle D B C$ ). So $C F B$ is an isosceles triangle and $B C=C F=E D$ (ECFD is a parallelogram). In a similar manner, $E C=A D$. But since $A B C D$ is a parallelogram, $A D=B C$, whence $E C=E D$. So the diagonals of $A B C D$ are equal, which means that $A B C D$ is in fact a rectangle. Also, the triangles $E D A$ and $E B C$ are equilateral, and so $A B$ is twice the altitude of $E D A$, or $A B=\sqrt{3} \cdot A D$.

Problem 12.

A circle passes through vertex $B$ of the triangle $A B C$, intersects its sides $A B$ and $B C$ at points $K$ and $L$, respectively, and touches the side $A C$ at its midpoint $M$. The point $N$ on the $\operatorname{arc} B L$ (which does not contain $K)$ is such that $\angle L K N=\angle A C B$. Find $\angle B A C$ given that the triangle $C K N$ is equilateral.

Solution. Answer: $\angle B A C=75^{\circ}$.

Since $\angle A C B=\angle L K N=\angle L B N$, the lines $A C$ and $B N$ are parallel. Hence $A C N B$ is a trapezium. Moreover, $A C N B$ is an isosceles trapezium, because the segment $A C$ touches the circle $s$ in the midpoint (and so the trapezium is symmetrical with respect to the perpendicular bisectors of $B N$ ).

Figure 2: Problem 12.

Denote by $K^{\prime}$ the intersection point of $s$ and $C N$. Then the line $K K^{\prime}$ is parallel to the bases of the trapezium. Hence $M$ is the midpoint of $\operatorname{arc} K K^{\prime}$ and the line $N M$ is an angle bisector of the equilateral triangle $K N C$.

Thus we obtain that $M C=M K$. Therefore the length of median $K M$ of the triangle $A K C$ equals $\frac{1}{2} A C$; hence $\angle A K C=90^{\circ}$. We have

2A=KAC+ACN=KAC+ACK+KCN=90+60=150 2 \angle A=\angle K A C+\angle A C N=\angle K A C+\angle A C K+\angle K C N=90^{\circ}+60^{\circ}=150^{\circ} \text {, }

and so $\angle A=75^{\circ}$.

Problem 13.

Let $D$ be the footpoint of the altitude from $B$ in the triangle $A B C$, where $A B=1$. The incentre of triangle $B C D$ coincides with the centroid of triangle $A B C$. Find the lengths of $A C$ and $B C$.

Solution. Answer: $A C=B C=\sqrt{\frac{5}{2}}$.

The centroid of $A B C$ lies on the median $C C^{\prime}$. It will also, by the assumption, lie on the angle bisector through $C$. Since the median and the angle bisector coincide, $A B C$ is isosceles with $A C=$ $B C=a$.

Furthermore, the centroid lies on the median $B B^{\prime}$ and the bisector of $\angle D B C$, again by hypothesis. By the Angle Bisector Theorem,

BDBD=BCBC=a/2a=12 \frac{B^{\prime} D}{B D}=\frac{B^{\prime} C}{B C}=\frac{a / 2}{a}=\frac{1}{2}

The triangles $A B D \sim A C C^{\prime}$ since they have equal angles, whence

1a=ABAC=ADAC=a/2BD1/2=aBD \frac{1}{a}=\frac{A B}{A C}=\frac{A D}{A C^{\prime}}=\frac{a / 2-B^{\prime} D}{1 / 2}=a-B D

Using the fact that the length of the altitude $C C^{\prime}$ is $\sqrt{a^{2}-\frac{1}{4}}$, this leads to

a21=aBD=2ABC=a214, a^{2}-1=a B D=2|A B C|=\sqrt{a^{2}-\frac{1}{4}},

or, equivalently,

a21=a214 a^{2}-1=\sqrt{a^{2}-\frac{1}{4}}

Clearly, $a>1$, and the only solution is $a=\sqrt{\frac{5}{2}}$.

Problem 14.

In the non-isosceles triangle $A B C$ the altitude from $A$ meets side $B C$ in $D$. Let $M$ be the midpoint of $B C$ and let $N$ be the reflection of $M$ in $D$. The circumcircle of the triangle $A M N$ intersects the side $A B$ in $P \neq A$ and the side $A C$ in $Q \neq A$. Prove that $A N, B Q$ and $C P$ are concurrent.

Solution 1. Without loss of generality, we assume the order of the points on $B C$ to be $B, M, D, N$, $C$. This implies that $P$ is on the segment $A B$ and $Q$ is on the segment $A C$.

Since $D$ is the midpoint of $M N$ and $A D$ is perpendicular to $M N$, the line $A D$ is the perpendicular bisector of $M N$, which contains the circumcentre of $\triangle A M N$. As $A$ is on the perpendicular bisector of $M N$, we have $|A M|=|A N|$. We now have $\angle A P M=\angle A Q N$. Therefore

CQN=180AQN=180APM=BPM \angle C Q N=180^{\circ}-\angle A Q N=180^{\circ}-\angle A P M=\angle B P M \text {. }

Furthermore, as $N M P Q$ is cyclic, we have

NQP=180NMP=BMP \angle N Q P=180^{\circ}-\angle N M P=\angle B M P \text {. }

Hence

AQP=180CQNNQP=180BPMBMP=PBM=ABC. \angle A Q P=180^{\circ}-\angle C Q N-\angle N Q P=180^{\circ}-\angle B P M-\angle B M P=\angle P B M=\angle A B C .

Similarly,

APQ=BCA \angle A P Q=\angle B C A \text {. }

Now we have $\triangle A P Q \sim \triangle A C B$. So

APAQ=ACAB \frac{|A P|}{|A Q|}=\frac{|A C|}{|A B|}

Furthermore, $\angle M A B=\angle M A P=\angle M N P=\angle B N P$, so $\triangle B M A \sim \triangle B P N$, and hence

BNBP=BABM \frac{|B N|}{|B P|}=\frac{|B A|}{|B M|}

We also have $\angle C A M=\angle Q A M=180^{\circ}-\angle Q N M=\angle Q N C$. This implies $\triangle C M A \sim \triangle C Q N$, so

CQCN=CMCA \frac{|C Q|}{|C N|}=\frac{|C M|}{|C A|}

Putting everything together, we find

BNBPCQCNAPAQ=BABMCMCAACAB \frac{|B N|}{|B P|} \cdot \frac{|C Q|}{|C N|} \cdot \frac{|A P|}{|A Q|}=\frac{|B A|}{|B M|} \cdot \frac{|C M|}{|C A|} \cdot \frac{|A C|}{|A B|}

As $|B M|=|C M|$, the right-hand side is equal to 1 . This means that

BNNCCQQAAPPB=1 \frac{|B N|}{|N C|} \cdot \frac{|C Q|}{|Q A|} \cdot \frac{|A P|}{|P B|}=1

With Ceva's theorem we can conclude that $A N, B Q$ and $C P$ are concurrent.

Solution 2. We consider the same configuration as in Solution 1. Let $K$ be the second intersection of $A D$ with the circumcircle of $\triangle A M N$. Since $D$ is the midpoint of $M N$ and $A D$ is perpendicular to $M N$, the line $A D$ is the perpendicular bisector of $M N$, which contains the circumcentre of $\triangle A M N$. So $A K$ is a diameter of this circumcircle. Now we have $\angle B P K=90^{\circ}=\angle B D K$, so $B P D K$ is a cyclic quadrilateral. Also, $A, M, N, K, P$ and $Q$ are concyclic. Using both circles, we find

180CQP=AQP=AKP=DKP=DBP=CBP. 180^{\circ}-\angle C Q P=\angle A Q P=\angle A K P=\angle D K P=\angle D B P=\angle C B P .

This implies that $B P Q C$ is cyclic as well. Using the power theorem we find $A P \cdot A B=A Q \cdot A C$, with directed lengths. Also, $B N \cdot B M=B P \cdot B A$ and $C N \cdot C M=C Q \cdot C A$. Hence

APABBNBMCQCA=AQACBPBACNCM A P \cdot A B \cdot B N \cdot B M \cdot C Q \cdot C A=A Q \cdot A C \cdot B P \cdot B A \cdot C N \cdot C M

Changing the signs of all six lengths on the right-hand side and replacing $M C$ by $B M$, we find

APABBNBMCQCA=QACAPBABNCBM A P \cdot A B \cdot B N \cdot B M \cdot C Q \cdot C A=Q A \cdot C A \cdot P B \cdot A B \cdot N C \cdot B M

Cleaning this up, we have

APBNCQ=QAPBNC, A P \cdot B N \cdot C Q=Q A \cdot P B \cdot N C,

implying

BNNCCQQAAPPB=1 \frac{B N}{N C} \cdot \frac{C Q}{Q A} \cdot \frac{A P}{P B}=1

With Ceva's theorem we can conclude that $A N, B Q$ and $C P$ are concurrent.

Problem 15.

In triangle $A B C$, the interior and exterior angle bisectors of $\angle B A C$ intersect the line $B C$ in $D$ and $E$, respectively. Let $F$ be the second point of intersection of the line $A D$ with the circumcircle of the triangle $A B C$. Let $O$ be the circumcentre of the triangle $A B C$ and let $D^{\prime}$ be the reflection of $D$ in $O$. Prove that $\angle D^{\prime} F E=90^{\circ}$.

Solution 1. Note that $A B \neq A C$, since otherwise the exterior angle bisector of $\angle B A C$ would be parallel to $B C$. So assume without loss of generality that $A B<A C$. Let $M$ be the midpoint of $B C$ and let $F^{\prime}$ the reflection of $F$ in $O$, which is also the second intersection of the line $A E$ with the circumcircle of $\triangle A B C$. We now have

DFO=OFD \angle D^{\prime} F O=\angle O F^{\prime} D \text {. }

Since $\angle D M F^{\prime}=90^{\circ}=\angle D A F^{\prime}$, the quadrilateral $M D A F^{\prime}$ is cyclic, thus

OFD=MFD=MAD \angle O F^{\prime} D=\angle M F^{\prime} D=\angle M A D \text {. }

Furthermore, $\angle F M E=90^{\circ}=\angle F A E$, so $F M A E$ is cyclic as well. This implies that

MAD=MAF=MEF. \angle M A D=\angle M A F=\angle M E F .

Combining these three equalities we find that $\angle D^{\prime} F O=\angle M E F$, thus

DFE=DFO+OFE=MEF+MFE=180EMF=90. \angle D^{\prime} F E=\angle D^{\prime} F O+\angle O F E=\angle M E F+\angle M F E=180^{\circ}-\angle E M F=90^{\circ} .

Solution 2. Again, assume $A B<A C$ and define $F^{\prime}$ as in the previous solution. Let $G$ be the intersection of the lines $D F^{\prime}$ and $E F$.

We can easily see that $F A$ is perpendicular to $E F^{\prime}$, and $B C$ to $F F^{\prime}$. Now, in triangle $\triangle E F F^{\prime}$, we have that $F D$ and $E D$ are altitudes, so $D$ is the orthocentre of this triangle. Now, $F^{\prime} D$ is an altitude

as well and we find that $F^{\prime} G$ is perpendicular to $E F$. Since $F F^{\prime}$ is a diameter of the circumcircle of $\triangle A B C, G$ must lie on this circle as well.

We now find

EFA=GFA=GFA=DFA \angle E F A=\angle G F A=\angle G F^{\prime} A=\angle D F^{\prime} A \text {. }

Also, $\angle D F^{\prime} F=\angle D^{\prime} F F^{\prime}$. This implies that

DFE=DFF+FFA+AFE=DFF+FFA+AFD=FFA+AFF \angle D^{\prime} F E=\angle D^{\prime} F F^{\prime}+\angle F^{\prime} F A+\angle A F E=\angle D F^{\prime} F+\angle F^{\prime} F A+\angle A F^{\prime} D=\angle F^{\prime} F A+\angle A F^{\prime} F \text {. }

Now, in triangle $\triangle A F F^{\prime}$ we have

FFA+AFF=180FAF=90, \angle F^{\prime} F A+\angle A F^{\prime} F=180^{\circ}-\angle F A F^{\prime}=90^{\circ},

as required.

Solution 3. Again, assume $A B<A C$. We first consider the case $\angle B A C=90^{\circ}$. Define $F^{\prime}$ as in the previous solution. Now $O$ and $D^{\prime}$ lie on $B C$, so $\triangle D^{\prime} F O$ and $\triangle D F O$ are mirror images with respect to $F F^{\prime}$, while $\triangle O F E$ and $\triangle O F^{\prime} E$ are mirror images with respect to $B C$. We find that

DFE=DFO+OFE=DFO+OFE=AFF+FFA=180FAF=90. \angle D^{\prime} F E=\angle D^{\prime} F O+\angle O F E=\angle D F O+\angle O F^{\prime} E=\angle A F F^{\prime}+\angle F F^{\prime} A=180^{\circ}-\angle F A F^{\prime}=90^{\circ} .

Now assume that $\angle B A C \neq 90^{\circ}$. We consider the configuration where $\angle B A C<90^{\circ}$. Let $M$, $N$ and $L$ be the midpoints of the line segments $B C, D E$ and $D F$, respectively. Note that $N$ is the circumcentre of $\triangle A D E$, so we find

NAF=NAD=NDA=DAC+ACD=12A+ACD=BAF+ACD=BCF+ACD=ACF. \begin{aligned} \angle N A F=\angle N A D=\angle N D A & =\angle D A C+\angle A C D \\ & =\frac{1}{2} \angle A+\angle A C D=\angle B A F+\angle A C D=\angle B C F+\angle A C D=\angle A C F . \end{aligned}

Hence $N A$ is tangent to the circumcircle of $\triangle A B C$, thus $N A \perp O A$. Furthermore, we have $N M \perp$ $O M$, so $A O M N$ is cyclic with $O N$ as diameter. Now, since $L$ is the circumcentre of $\triangle D M F$, we find

LMN=LMD=LDM=ADN=DAN=LAN \angle L M N=\angle L M D=\angle L D M=\angle A D N=\angle D A N=\angle L A N

so $A N L M$ is cyclic. Combining this with what we found before, we now conclude that $A O M L N$ is cyclic with $O N$ as diameter, thus $\angle O L N=90^{\circ}$. Using a dilation with centre $D$ and factor 2 we now can conclude $\angle D^{\prime} F E=\angle O L N=90^{\circ}$.

In case $\angle B A C>90^{\circ}$, the proof is similar (the cyclic quadrilateral will this time be $A M O N$ ).

Solution 4. We consider the configuration where $C, D, B$ and $E$ are on the line $B C$ in that order. The other configuration can be solved analogously. Let $P$ and $R$ be the feet of the perpendiculars from $D^{\prime}$ and $O$ to the line $A D$, respectively, and let $Q$ and $S$ be the feet of the perpendiculars from $D^{\prime}$ and $O$ to the line $C D$, respectively. Since $D^{\prime}$ is the reflection of $D$ with respect to $O$, we have $P R=R D$. Since we also have $O A=O F$ and therefore $R A=R F$, we obtain $A D=P F$. Similarly, $C D=B Q$. By Pythagoras's theorem,

DF2=DP2+PF2=4OR2+AD2=4OA24AR2+AD2=4OA2AF2+AD2 D^{\prime} F^{2}=D^{\prime} P^{2}+P F^{2}=4 O R^{2}+A D^{2}=4 O A^{2}-4 A R^{2}+A D^{2}=4 O A^{2}-A F^{2}+A D^{2}

and

DE2=DQ2+EQ2=4OS2+EQ2=4OB24BS2+EQ2=4OB2BC2+(EB+CD)2. D^{\prime} E^{2}=D^{\prime} Q^{2}+E Q^{2}=4 O S^{2}+E Q^{2}=4 O B^{2}-4 B S^{2}+E Q^{2}=4 O B^{2}-B C^{2}+(E B+C D)^{2} .

And since $\angle E A F=90^{\circ}$ we have

EF2=AE2+AF2. E F^{2}=A E^{2}+A F^{2} .

As $O A=O B$, we conclude that

DF2+EF2DE2=(4OA2AF2+AD2)+(AE2+AF2)(4OB2BC2+(EB+CD)2)=AE2+AD2+BC2(EB+CD)2 \begin{array}{r} D^{\prime} F^{2}+E F^{2}-D^{\prime} E^{2}=\left(4 O A^{2}-A F^{2}+A D^{2}\right)+\left(A E^{2}+A F^{2}\right)-\left(4 O B^{2}-B C^{2}+(E B+C D)^{2}\right) \\ =A E^{2}+A D^{2}+B C^{2}-(E B+C D)^{2} \end{array}

By Pythagoras's theorem again, we obtain $A E^{2}+A D^{2}=E D^{2}$, and hence

DF2+EF2DE2=ED2+BC2(EB+CD)2. D^{\prime} F^{2}+E F^{2}-D^{\prime} E^{2}=E D^{2}+B C^{2}-(E B+C D)^{2} .

We have

ED2+BC2=(EB+BD)2+(BD+CD)2=EB2+BD2+2EBBD+BD2+CD2+2BDCD=EB2+CD2+2BD(EB+BD+CD)=EB2+CD2+2BDEC. \begin{aligned} E D^{2}+B C^{2} & =(E B+B D)^{2}+(B D+C D)^{2} \\ & =E B^{2}+B D^{2}+2 \cdot E B \cdot B D+B D^{2}+C D^{2}+2 \cdot B D \cdot C D \\ & =E B^{2}+C D^{2}+2 \cdot B D \cdot(E B+B D+C D) \\ & =E B^{2}+C D^{2}+2 \cdot B D \cdot E C . \end{aligned}

By the internal and external bisector theorems, we have

BDCD=BACA=BECE, \frac{B D}{C D}=\frac{B A}{C A}=\frac{B E}{C E},

hence

ED2+BC2=EB2+CD2+2CDBE=(EB+CD)2. E D^{2}+B C^{2}=E B^{2}+C D^{2}+2 \cdot C D \cdot B E=(E B+C D)^{2} .

So

DF2+EF2DE2=0, D^{\prime} F^{2}+E F^{2}-D^{\prime} E^{2}=0,

which implies that $\angle D^{\prime} F E=90^{\circ}$.

Problem 16.

Denote by $P(n)$ the greatest prime divisor of $n$. Find all integers $n \geq 2$ for which

P(n)+n=P(n+1)+n+1. P(n)+\lfloor\sqrt{n}\rfloor=P(n+1)+\lfloor\sqrt{n+1}\rfloor .

(Note: $\lfloor x\rfloor$ denotes the greatest integer less than or equal to $x$.)

Solution. Answer: The equality holds only for $n=3$.

It is easy to see that $P(n) \neq P(n+1)$. Therefore we need also that $\lfloor\sqrt{n}\rfloor \neq\lfloor\sqrt{n+1}\rfloor$ in order for equality to hold. This is only possible if $n+1$ is a perfect square. In this case,

n+1=n+1 \lfloor\sqrt{n}\rfloor+1=\lfloor\sqrt{n+1}\rfloor

and hence $P(n)=P(n+1)+1$. As both $P(n)$ and $P(n+1)$ are primes, it must be that $P(n)=3$ and $P(n+1)=2$.

It follows that $n=3^{a}$ and $n+1=2^{b}$, and we are required to solve the equation $3^{a}=2^{b}-1$. Calculating modulo 3 , we find that $b$ is even. Put $b=2 c$ :

3a=(2c1)(2c+1). 3^{a}=\left(2^{c}-1\right)\left(2^{c}+1\right) .

As both factors cannot be divisible by 3 (their difference is 2 ), $2^{c}-1=1$. From this we get $c=1$, which leads to $n=3$.

Problem 17.

Find all positive integers $n$ for which $n^{n-1}-1$ is divisible by $2^{2015}$, but not by $2^{2016}$.

Solution. Since $n$ must be odd, write $n=2^{d} u+1$, where $u, d \in \mathbf{N}$ and $u$ is odd. Now

nn11=(n2d1)(n2d(u1)++n2d1+1u), n^{n-1}-1=\left(n^{2^{d}}-1\right)(\underbrace{n^{2^{d} \cdot(u-1)}+\cdots+n^{2^{d} \cdot 1}+1}_{u}),

and hence $2^{2015} |\left(n^{n-1}-1\right)$ iff $2^{2015} |\left(n^{2^{d}}-1\right)$. (The notation $p^{k} | m$ denotes that $p^{k} \mid m$ and $p^{k+1} \nmid m$.)

We factorise once more:

n2d1=(n1)(n+1)(n2+1)(n2d1+1)d1=2du2(2d1u+1)(n2+1)(n2d1+1)d1. \begin{aligned} n^{2^{d}}-1 & =(n-1)(n+1) \underbrace{\left(n^{2}+1\right) \cdots\left(n^{2^{d-1}}+1\right)}_{d-1} \\ & =2^{d} u \cdot 2\left(2^{d-1} u+1\right) \underbrace{\left(n^{2}+1\right) \cdots\left(n^{2^{d-1}}+1\right)}_{d-1} . \end{aligned}

If $k \geq 1$, then $2 | n^{2^{k}}+1$, and so from the above

22d2du2(n2+1)(n2d1+1)d1 and 220152d(2d1u+1) 2^{2 d} \| 2^{d} u \cdot 2 \cdot \underbrace{\left(n^{2}+1\right) \cdots\left(n^{2^{d-1}}+1\right)}_{d-1} \quad \text { and } \quad 2^{2015-2 d} \|\left(2^{d-1} u+1\right)

It is easy to see that this is the case exactly when $d=1$ and $u=2^{2013} v-1$, where $v$ is odd.

Hence the required numbers are those of the form

n=2(22013v1)+1=22014v1 n=2\left(2^{2013} v-1\right)+1=2^{2014} v-1

for $v$ a positive odd number.

Problem 18.

Let $f(x)=x^{n}+a_{n-1} x^{n-1}+\cdots+a_{0}$ be a polynomial of degree $n \geq 1$ with $n$ (not necessarily distinct) integer roots. Assume that there exist distinct primes $p_{0}, p_{1}, \ldots, p_{n-1}$ such that $a_{i}>1$ is a power of $p_{i}$, for all $i=0, \ldots, n-1$. Find all possible values of $n$.

Solution. Obviously all the roots have to be negative by the positivity of the coefficients. If at least two of the roots are unequal to -1 , then both of them have to be powers of $p_{0}$. Now Vieta's formulæ yield $p_{0} \mid a_{1}$, which is a contradiction. Thus we can factor $f$ as

f(x)=(x+a0)(x+1)n1 f(x)=\left(x+a_{0}\right)(x+1)^{n-1}

Expanding yields

a2=(n11)+a0(n12) and an2=a0(n1n2)+(n1n3) a_{2}=\left(\begin{array}{c} n-1 \\ 1 \end{array}\right)+a_{0}\left(\begin{array}{c} n-1 \\ 2 \end{array}\right) \quad \text { and } \quad a_{n-2}=a_{0}\left(\begin{array}{l} n-1 \\ n-2 \end{array}\right)+\left(\begin{array}{l} n-1 \\ n-3 \end{array}\right)

If $n \geq 5$, we see that $2 \neq n-2$ and so the two coefficients above are relatively prime, being powers of two distinct primes. However, depending on the parity of $n$, we have that $a_{2}$ and $a_{n-2}$ are both divisible by $n-1$ or $\frac{n-1}{2}$, which is a contradiction.

For $n=1,2,3,4$, the following polynomials meet the requirements:

f1(x)=x+2f2(x)=(x+2)(x+1)=x2+3x+2f3(x)=(x+3)(x+1)2=x3+5x2+7x+3f4(x)=(x+2)(x+1)3=x4+5x3+9x2+7x+2 \begin{aligned} & f_{1}(x)=x+2 \\ & f_{2}(x)=(x+2)(x+1)=x^{2}+3 x+2 \\ & f_{3}(x)=(x+3)(x+1)^{2}=x^{3}+5 x^{2}+7 x+3 \\ & f_{4}(x)=(x+2)(x+1)^{3}=x^{4}+5 x^{3}+9 x^{2}+7 x+2 \end{aligned}

Problem 19.

Three pairwise distinct positive integers $a, b, c$, with $\operatorname{gcd}(a, b, c)=1$, satisfy

a(bc)2,b(ca)2 and c(ab)2 a\left|(b-c)^{2}, \quad b\right|(c-a)^{2} \quad \text { and } \quad c \mid(a-b)^{2} \text {. }

Prove that there does not exist a non-degenerate triangle with side lengths $a, b, c$.

Solution. First observe that these numbers are pairwise coprime. Indeed, if, say, $a$ and $b$ are divisible by a prime $p$, then $p$ divides $b$, which divides $(a-c)^{2}$; hence $p$ divides $a-c$, and therefore $p$ divides $c$. Thus, $p$ is a common divisor of these three numbers, a contradiction.

Now consider the number

M=2ab+2bc+2aca2b2c2. M=2 a b+2 b c+2 a c-a^{2}-b^{2}-c^{2} .

It is clear from the problem condition that $M$ is divisible by $a, b, c$, and therefore $M$ is divisible by $a b c$.

Assume that a triangle with sides $a, b, c$ exists. Then $a<b+c$, and so $a^{2}<a b+a c$. Analogously, we have $b^{2}<b c+b a$ and $c^{2}<c a+c b$. Summing these three inequalities leads to $M>0$, and hence $M \geq a b c$.

On the other hand,

a2+b2+c2>ab+bc+ac a^{2}+b^{2}+c^{2}>a b+b c+a c

and therefore $M<a b+b c+a c$. Supposing, with no loss of generality, $a>b>c$, we must have $M<3 a b$. Taking into account the inequality $M \geq a b c$, we conclude that $c=1$ or $c=2$ are the only possibilities.

For $c=1$ we have $b<a<b+1$ (the first inequality is our assumption, the second is the triangle inequality), a contradiction.

For $c=2$ we have $b<a<b+2$, i.e. $a=b+1$. But then $1=(a-b)^{2}$ is not divisible by $c=2$.

Problem 20.

For any integer $n \geq 2$, we define $A_{n}$ to be the number of positive integers $m$ with the following property: the distance from $n$ to the nearest non-negative multiple of $m$ is equal to the distance from $n^{3}$ to the nearest non-negative multiple of $m$. Find all integers $n \geq 2$ for which $A_{n}$ is odd.

(Note: The distance between two integers $a$ and $b$ is defined as $|a-b|$.)

Solution. For an integer $m$ we consider the distance $d$ from $n$ to the nearest multiple of $m$. Then $m \mid n \pm d$, which means $n \equiv \pm d \bmod m$. So if, for some $m$, the distance from $n$ to the nearest multiple of $m$ is equal to the distance from $n^{3}$ to the nearest multiple of $m$, then $n \equiv \pm n^{3} \bmod m$.

On the other hand, if $n \equiv \pm n^{3} \bmod m$, then there exists a $0 \leq d \leq \frac{1}{2} m$ such that $n \equiv \pm d \bmod m$ and $n^{3} \equiv \pm d \bmod m$, so the distance from $n$ to the nearest multiple of $m$ is equal to the distance from $n^{3}$ to the nearest multiple of $m$.

We conclude that we need to count the number of positive integers $m$ such that $n \equiv \pm n^{3} \bmod m$, or, equivalently, $m \mid n^{3}-n$ or $m \mid n^{3}+n$. That is,

An={mZ+mn3n or mn3+n}={mZ+mn3n}+{mZ+mn3+n}{mZ+mn3n and mn3+n}={mZ+mn3n}+{mZ+mn3+n}{mZ+mgcd(n3n,n3+n)}=τ(n3n)+τ(n3+n)τ(gcd(n3n,n3+n)), \begin{aligned} & A_{n}=\mid\left\{m \in \mathbf{Z}^{+}|m| n^{3}-n \text { or } m \mid n^{3}+n\right\} \mid \\ & =\left|\left\{m \in \mathbf{Z}^{+}|m| n^{3}-n\right\}\right|+\left|\left\{m \in \mathbf{Z}^{+}|m| n^{3}+n\right\}\right|-\mid\left\{m \in \mathbf{Z}^{+}|m| n^{3}-n \text { and } m \mid n^{3}+n\right\} \mid \\ & =\left|\left\{m \in \mathbf{Z}^{+}|m| n^{3}-n\right\}\right|+\left|\left\{m \in \mathbf{Z}^{+}|m| n^{3}+n\right\}\right|-\left|\left\{m \in \mathbf{Z}^{+}|m| \operatorname{gcd}\left(n^{3}-n, n^{3}+n\right)\right\}\right| \\ & =\tau\left(n^{3}-n\right)+\tau\left(n^{3}+n\right)-\tau\left(\operatorname{gcd}\left(n^{3}-n, n^{3}+n\right)\right), \end{aligned}

where $\tau(k)$ denotes the number of (positive) divisors of a positive integer $k$.

Recall that $\tau(k)$ is odd if and only if $k$ is a square. Furthermore, we have

gcd(n,n2±1)=1 \operatorname{gcd}\left(n, n^{2} \pm 1\right)=1

So if $n^{3} \pm n$ were a square, then both $n$ and $n^{2} \pm 1$ would be squares. But $n^{2} \pm 1$ is not a square, since $n \geq 2$ and the only consecutive squares are 0,1 . Hence neither $n^{3}-n$ nor $n^{3}+n$ is a square, so the first two terms $\tau\left(n^{3}-n\right)$ and $\tau\left(n^{3}+n\right)$ are both even. Hence $A_{n}$ is odd if and only if $\operatorname{gcd}\left(n^{3}-n, n^{3}+n\right)$ is a square.

We have

gcd(n21,n2+1)=gcd(n21,2)={1 if n even 2 if n odd  \operatorname{gcd}\left(n^{2}-1, n^{2}+1\right)=\operatorname{gcd}\left(n^{2}-1,2\right)= \begin{cases}1 & \text { if } n \text { even } \\ 2 & \text { if } n \text { odd }\end{cases}

Hence,

gcd(n3n,n3+n)={n if n even 2n if n odd  \operatorname{gcd}\left(n^{3}-n, n^{3}+n\right)= \begin{cases}n & \text { if } n \text { even } \\ 2 n & \text { if } n \text { odd }\end{cases}

Note that $2 n$ for $n$ odd is never a square, since it has exactly one factor of 2 . We conclude that $A_{n}$ is odd if and only if $n$ is an even square.