# Baltic Way 2003 Riga, November 2, 2003 ## Problems and solutions 1. Let $\mathbb{Q}_{+}$be the set of positive rational numbers. Find all functions $f: \mathbb{Q}_{+} \rightarrow \mathbb{Q}_{+}$which for all $x \in \mathbb{Q}_{+}$fulfil (1) $f\left(\frac{1}{x}\right)=f(x)$ (2) $\left(1+\frac{1}{x}\right) f(x)=f(x+1)$ Solution: Set $g(x)=\frac{f(x)}{f(1)}$. Function $g$ fulfils (1), (2) and $g(1)=1$. First we prove that if $g$ exists then it is unique. We prove that $g$ is uniquely defined on $x=\frac{p}{q}$ by induction on $\max (p, q)$. If $\max (p, q)=1$ then $x=1$ and $g(1)=1$. If $p=q$ then $x=1$ and $g(x)$ is unique. If $p \neq q$ then we can assume (according to (1)) that $p>q$. From (2) we get $g\left(\frac{p}{q}\right)=\left(1+\frac{q}{p-q}\right) g\left(\frac{p-q}{q}\right)$. The induction assumption and $\max (p, q)>\max (p-q, q) \geq 1$ now give that $g\left(\frac{p}{q}\right)$ is unique. Define the function $g$ by $g\left(\frac{p}{q}\right)=p q$ where $p$ and $q$ are chosen such that $\operatorname{gcd}(p, q)=1$. It is easily seen that $g$ fulfils (1), (2) and $g(1)=1$. All functions fulfilling (1) and (2) are therefore $f\left(\frac{p}{q}\right)=a p q$, where $\operatorname{gcd}(p, q)=1$ and $a \in \mathbb{Q}_{+}$. 2. Prove that any real solution of $$ x^{3}+p x+q=0 $$ satisfies the inequality $4 q x \leq p^{2}$. Solution: Let $x_{0}$ be a root of the qubic, then $x^{3}+p x+q=\left(x-x_{0}\right)\left(x^{2}+a x+b\right)=$ $x^{3}+\left(a-x_{0}\right) x^{2}+\left(b-a x_{0}\right) x-b x_{0}$. So $a=x_{0}, p=b-a x_{0}=b-x_{0}^{2},-q=b x_{0}$. Hence $p^{2}=b^{2}-2 b x_{0}^{2}+x_{0}^{4}$. Also $4 x_{0} q=-4 x_{0}^{2} b$. So $p^{2}-4 x_{0} q=b^{2}+2 b x_{0}^{2}+x_{0}^{4}=\left(b+x_{0}^{2}\right)^{2} \geq 0$. Solution 2: As the equation $x_{0} x^{2}+p x+q=0$ has a root $\left(x=x_{0}\right)$, we must have $D \geq 0 \Leftrightarrow p^{2}-4 q x_{0} \geq 0$. (Also the equation $x^{2}+p x+q x_{0}=0$ having the root $x=x_{0}^{2}$ can be considered.) 3. Let $x, y$ and $z$ be positive real numbers such that $x y z=1$. Prove that $$ (1+x)(1+y)(1+z) \geq 2\left(1+\sqrt[3]{\frac{y}{x}}+\sqrt[3]{\frac{z}{y}}+\sqrt[3]{\frac{x}{z}}\right) $$ Solution: Put $a=b x, b=c y$ and $c=a z$. The given inequality then takes the form $$ \begin{aligned} \left(1+\frac{a}{b}\right)\left(1+\frac{b}{c}\right)\left(1+\frac{c}{a}\right) & \geq 2\left(1+\sqrt[3]{\frac{b^{2}}{a c}}+\sqrt[3]{\frac{c^{2}}{a b}}+\sqrt[3]{\frac{a^{2}}{b c}}\right) \\ & =2\left(1+\frac{a+b+c}{3 \sqrt[3]{a b c}}\right) . \end{aligned} $$ By the AM-GM inequality we have $$ \begin{aligned} \left(1+\frac{a}{b}\right)\left(1+\frac{b}{c}\right)\left(1+\frac{c}{a}\right) & =\frac{a+b+c}{a}+\frac{a+b+c}{b}+\frac{a+b+c}{c}-1 \\ & \geq 3\left(\frac{a+b+c}{\sqrt[3]{a b c}}\right)-1 \geq 2 \frac{a+b+c}{\sqrt[3]{a b c}}+3-1=2\left(1+\frac{a+b+c}{\sqrt[3]{a b c}}\right) . \end{aligned} $$ Solution 2: Expanding the left side we obtain $$ x+y+z+\frac{1}{x}+\frac{1}{y}+\frac{1}{z} \geq 2\left(\sqrt[3]{\frac{y}{x}}+\sqrt[3]{\frac{z}{y}}+\sqrt[3]{\frac{x}{z}}\right) $$ As $\sqrt[3]{\frac{y}{x}} \leq \frac{1}{3}\left(y+\frac{1}{x}+1\right)$ etc., it suffices to prove that $$ x+y+z+\frac{1}{x}+\frac{1}{y}+\frac{1}{z} \geq \frac{2}{3}\left(x+y+z+\frac{1}{x}+\frac{1}{y}+\frac{1}{z}\right)+2 $$ which follows from $a+\frac{1}{a} \geq 2$. 4. Let $a, b, c$ be positive real numbers. Prove that $$ \frac{2 a}{a^{2}+b c}+\frac{2 b}{b^{2}+c a}+\frac{2 c}{c^{2}+a b} \leq \frac{a}{b c}+\frac{b}{c a}+\frac{c}{a b} . $$ Solution: First we prove that $$ \frac{2 a}{a^{2}+b c} \leq \frac{1}{2}\left(\frac{1}{b}+\frac{1}{c}\right) $$ which is equivalent to $0 \leq b(a-c)^{2}+c(a-b)^{2}$, and therefore holds true. Now we turn to the inequality $$ \frac{1}{b}+\frac{1}{c} \leq \frac{1}{2}\left(\frac{2 a}{b c}+\frac{b}{c a}+\frac{c}{a b}\right), $$ which by multiplying by $2 a b c$ is seen to be equivalent to $0 \leq(a-b)^{2}+(a-c)^{2}$. Hence we have proved that Analogously we have $$ \frac{2 a}{a^{2}+b c} \leq \frac{1}{4}\left(\frac{2 a}{b c}+\frac{b}{c a}+\frac{c}{a b}\right) . $$ $$ \begin{aligned} \frac{2 b}{b^{2}+c a} & \leq \frac{1}{4}\left(\frac{2 b}{c a}+\frac{c}{a b}+\frac{a}{b c}\right) \\ \frac{2 c}{c^{2}+a b} & \leq \frac{1}{4}\left(\frac{2 c}{a b}+\frac{a}{b c}+\frac{b}{c a}\right) \end{aligned} $$ and it suffices to sum the above three inequalities. Solution 2: As $a^{2}+b c \geq 2 a \sqrt{b c}$ etc., it is sufficient to prove that $$ \frac{1}{\sqrt{b c}}+\frac{1}{\sqrt{a c}}+\frac{1}{\sqrt{a b}} \leq \frac{a}{b c}+\frac{b}{c a}+\frac{c}{a b} $$ which can be obtained by "inserting" $\frac{1}{a}+\frac{1}{b}+\frac{1}{c}$ between the left side and the right side. 5. A sequence $\left(a_{n}\right)$ is defined as follows: $a_{1}=\sqrt{2}, a_{2}=2$, and $a_{n+1}=a_{n} a_{n-1}^{2}$ for $n \geq 2$. Prove that for every $n \geq 1$ we have $$ \left(1+a_{1}\right)\left(1+a_{2}\right) \cdots\left(1+a_{n}\right)<(2+\sqrt{2}) a_{1} a_{2} \cdots a_{n} . $$ Solution: First we prove inductively that for $n \geq 1, a_{n}=2^{2^{n-2}}$. We have $a_{1}=2^{2^{-1}}$, $a_{2}=2^{2^{0}}$ and $$ a_{n+1}=2^{2^{n-2}} \cdot\left(2^{2^{n-3}}\right)^{2}=2^{2^{n-2}} \cdot 2^{2^{n-2}}=2^{2^{n-1}} . $$ Since $1+a_{1}=1+\sqrt{2}$, we must prove, that $$ \left(1+a_{2}\right)\left(1+a_{3}\right) \cdots\left(1+a_{n}\right)<2 a_{2} a_{3} \cdots a_{n} . $$ The right-hand side is equal to $$ 2^{1+2^{0}+2^{1}+\cdots+2^{n-2}}=2^{2^{n-1}} $$ and the left-hand side $$ \begin{aligned} \left(1+2^{2^{0}}\right) & \left(1+2^{2^{1}}\right) \cdots\left(1+2^{2^{n-2}}\right) \\ & =1+2^{2^{0}}+2^{2^{1}}+2^{2^{0}+2^{1}}+2^{2^{2}}+\cdots+2^{2^{0}+2^{1}+\cdots+2^{n-2}} \\ & =1+2+2^{2}+2^{3}+\cdots+2^{2^{n-1}-1} \\ & =2^{2^{n-1}}-1 . \end{aligned} $$ The proof is complete. 6. Let $n \geq 2$ and $d \geq 1$ be integers with $d \mid n$, and let $x_{1}, x_{2}, \ldots, x_{n}$ be real numbers such that $x_{1}+x_{2}+\cdots+x_{n}=0$. Prove that there are at least $\left(\begin{array}{l}n-1 \\ d-1\end{array}\right)$ choices of $d$ indices $1 \leq i_{1}10000$, so $a \cdot b \notin X$. So $X$ may have 9901 elements. Suppose that $x_{1}1$ and consider the pairs $$ \begin{gathered} 200-x_{1},\left(200-x_{1}\right) \cdot x_{1} \\ 200-x_{2},\left(200-x_{2}\right) \cdot x_{2} \\ \vdots \\ 200-x_{k},\left(200-x_{k}\right) \cdot x_{k} \end{gathered} $$ Clearly $x_{1}2 b+p-2 k$ and $p$ is a prime, we conclude $2 b+p+2 k=p^{2}$ and $2 b+p-2 k=1$. By adding these equations we get $2 b+p=\frac{p^{2}+1}{2}$ and then $b=\left(\frac{p-1}{2}\right)^{2}$, so $a=b+p=\left(\frac{p+1}{2}\right)^{2}$. By checking we conclude that all the solutions are $(a, b)=\left(\left(\frac{p+1}{2}\right)^{2},\left(\frac{p-1}{2}\right)^{2}\right)$ with $p$ a prime greater than 2 . Solution 2: Let $p$ be a prime such that $a-b=p$ and let $a b=k^{2}$. We have $(b+p) b=k^{2}$, so $\operatorname{gcd}(b, b+p)=\operatorname{gcd}(b, p)$ is equal either to 1 or $p$. If $\operatorname{gcd}(b, b+p)=p$, let $b=b_{1} p$. Then $p^{2} b_{1}\left(b_{1}+1\right)=k^{2}, b_{1}\left(b_{1}+1\right)=m^{2}$, but this equation has no solutions. Hence $\operatorname{gcd}(b, b+p)=1$, and $$ b=u^{2} \quad b+p=v^{2} $$ so that $p=v^{2}-u^{2}=(v+u)(v-u)$. This in turn implies that $v-u=1$ and $v+u=p$, from which we finally obtain $a=\left(\frac{p+1}{2}\right)^{2}, b=\left(\frac{p-1}{2}\right)^{2}$, where $p$ must be an odd prime. 17. All the positive divisors of a positive integer $n$ are stored into an array in increasing order. Mary has to write a program which decides for an arbitrarily chosen divisor $d>1$ whether it is a prime. Let $n$ have $k$ divisors not greater than $d$. Mary claims that it suffices to check divisibility of $d$ by the first $\lceil k / 2\rceil$ divisors of $n$ : If a divisor of $d$ greater than 1 is found among them, then $d$ is composite, otherwise d is prime. Is Mary right? Answer: Yes, Mary is right. Solution: Let $d>1$ be a divisor of $n$. Suppose Mary's program outputs "composite" for $d$. That means it has found a divisor of $d$ greater than 1 . Since $d>1$, the array contains at least 2 divisors of $d$, namely 1 and $d$. Thus Mary's program does not check divisibility of $d$ by $d$ (the first half gets complete before reaching $d$ ) which means that the divisor found lays strictly between 1 and $d$. Hence $d$ is composite indeed. Suppose now $d$ being composite. Let $p$ be its smallest prime divisor; then $\frac{d}{p} \geq p$ or, equivalently, $d \geq p^{2}$. As $p$ is a divisor of $n$, it occurs in the array. Let $a_{1}, \ldots, a_{k}$ all divisors of $n$ smaller than $p$. Then $p a_{1}, \ldots, p a_{k}$ are less than $p^{2}$ and hence less than $d$. As $a_{1}, \ldots, a_{k}$ are all relatively prime with $p$, all the numbers $p a_{1}, \ldots, p a_{k}$ divide $n$. The numbers $a_{1}, \ldots, a_{k}, p a_{1}, \ldots, p a_{k}$ are pairwise different by construction. Thus there are at least $2 k+1$ divisors of $n$ not greater than $d$. So Mary's program checks divisibility of $d$ by at least $k+1$ smallest divisors of $n$, among which it finds $p$, and outputs "composite". 18. Every integer is coloured with exactly one of the colours BLUE, GREEN, RED, YELLOW. Can this be done in such a way that if $a, b, c, d$ are not all 0 and have the same colour, then $3 a-2 b \neq 2 c-3 d$ ? Answer: Yes. Solution: A colouring with the required property can be defined as follows. For a non-zero integer $k$ let $k^{*}$ be the integer uniquely defined by $k=5^{m} \cdot k^{*}$, where $m$ is a nonnegative integer and $5 \nmid k^{*}$. We also define $0^{*}=0$. Two non-zero integers $k_{1}, k_{2}$ receive the same colour if and only if $k_{1}^{*} \equiv k_{2}^{*}(\bmod 5)$; we assign 0 any colour. Assume $a, b, c, d$ has the same colour and that $3 a-2 b=2 c-3 d$, which we rewrite as $3 a-2 b-2 c+3 d=0$. Dividing both sides by the largest power of 5 which simultaneously divides $a, b, c, d$ (this makes sense since not all of $a, b, c, d$ are 0 ), we obtain $$ 3 \cdot 5^{A} \cdot a^{*}-2 \cdot 5^{B} \cdot b^{*}-2 \cdot 5^{C} \cdot c^{*}+3 \cdot 5^{D} \cdot d^{*}=0, $$ where $A, B, C, D$ are nonnegative integers at least one of which is equal to 0 . The above equality implies $$ 3\left(5^{A} \cdot a^{*}+5^{B} \cdot b^{*}+5^{C} \cdot c^{*}+5^{D} \cdot d^{*}\right) \equiv 0 \quad(\bmod 5) . $$ Assume $a, b, c, d$ are all non-zero. Then $a^{*} \equiv b^{*} \equiv c^{*} \equiv d^{*} \not \equiv 0(\bmod 5)$. This implies $$ 5^{A}+5^{B}+5^{C}+5^{D} \equiv 0 \quad(\bmod 5) $$ which is impossible since at least one of the numbers $A, B, C, D$ is equal to 0 . If one or more of $a, b, c, d$ are 0 , we simply omit the corresponding terms from (1), and the same conclusion holds. 19. Let $a$ and $b$ be positive integers. Prove that if $a^{3}+b^{3}$ is the square of an integer, then $a+b$ is not a product of two different prime numbers. Solution: Suppose $a+b=p q$, where $p \neq q$ are two prime numbers. We may assume that $p \neq 3$. Since $$ a^{3}+b^{3}=(a+b)\left(a^{2}-a b+b^{2}\right) $$ is a square, the number $a^{2}-a b+b^{2}=(a+b)^{2}-3 a b$ must be divisible by $p$ and $q$, whence $3 a b$ must be divisible by $p$ and $q$. But $p \neq 3$, so $p \mid a$ or $p \mid b$; but $p \mid a+b$, so $p \mid a$ and $p \mid b$. Write $a=p k, b=p \ell$ for some integers $k, \ell$. Notice that $q=3$, since otherwise, repeating the above argument, we would have $q|a, q| b$ and $a+b>p q)$. So we have $$ 3 p=a+b=p(k+\ell) $$ and we conclude that $a=p, b=2 p$ or $a=2 p, b=p$. Then $a^{3}+b^{3}=9 p^{3}$ is obviously not a square, a contradiction. 20. Let $n$ be a positive integer such that the sum of all the positive divisors of $n$ (except $n$ ) plus the number of these divisors is equal to $n$. Prove that $n=2 m^{2}$ for some integer $m$. Solution: Let $t_{1}