# Problems and Solutions, JBMO 2014 Problem 1. Find all distinct prime numbers $p, q$ and $r$ such that $$ 3 p^{4}-5 q^{4}-4 r^{2}=26 $$ Solution. First notice that if both primes $q$ and $r$ differ from 3 , then $q^{2} \equiv r^{2} \equiv 1(\bmod 3)$, hence the left hand side of the given equation is congruent to zero modulo 3 , which is impossible since 26 is not divisible by 3 . Thus, $q=3$ or $r=3$. We consider two cases. Case 1. $q=3$. The equation reduces to $3 p^{4}-4 r^{2}=431$ If $p \neq 5, \quad$ by Fermat's little theorem, $\quad p^{4} \equiv 1(\bmod 5)$, which yields $3-4 r^{2} \equiv 1(\bmod 5), \quad$ or equivalently, $\quad r^{2}+2 \equiv 0(\bmod 5)$. The last congruence is impossible in view of the fact that a residue of a square of a positive integer belongs to the set $\{0,1,4\}$. Therefore $p=5$ and $r=19$. Case 2. $r=3$. The equation becomes $3 p^{4}-5 q^{4}=62$ Obviously $p \neq 5$. Hence, Fermat's little theorem gives $p^{4} \equiv 1(\bmod 5)$. But then $5 q^{4} \equiv 1(\bmod 5)$, which is impossible . Hence, the only solution of the given equation is $p=5, q=3, r=19$. Problem 2. Consider an acute triangle $A B C$ with area S. Let $C D \perp A B \quad(D \in A B)$, $D M \perp A C \quad(M \in A C)$ and $\quad D N \perp B C \quad(N \in B C)$. Denote by $H_{1}$ and $H_{2}$ the orthocentres of the triangles $M N C$ and $M N D$ respectively. Find the area of the quadrilateral $\mathrm{AH}_{1} \mathrm{BH}_{2}$ in terms of $S$. Solution 1. Let $O, P, K, R$ and $T$ be the mid-points of the segments $C D, M N$, $C N, C H_{1}$ and $M H_{1}$, respectively. From $\triangle M N C$ we have that $\overline{P K}=\frac{1}{2} \overline{M C}$ and $P K \| M C$. Analogously, from $\Delta M H_{1} C$ we have that $\overline{T R}=\frac{1}{2} \overline{M C}$ and $T R \| M C$. Consequently, $\overline{P K}=\overline{T R}$ and $P K \| T R$. Also $O K \| D N \quad$ (from ![](https://cdn.mathpix.com/cropped/2024_06_05_e8f9a14accde81c04529g-2.jpg?height=657&width=834&top_left_y=554&top_left_x=994) $\triangle C D N$ ) and since $D N \perp B C$ and $M H_{1} \perp B C$, it follows that $T H_{1} \| O K$. Since $O$ is the circumcenter of $\triangle C M N, O P \perp M N$. Thus, $C H_{1} \perp M N$ implies $O P \| C H_{1}$. We conclude $\triangle T R H_{1} \cong \triangle K P O \quad$ (they have parallel sides and $\overline{T R}=\overline{P K}$ ), hence $\overline{R H_{1}}=\overline{P O}$, i.e. $\overline{C H_{1}}=2 \overline{P O}$ and $C H_{1} \| P O$. Analogously, $\overline{D H_{2}}=2 \overline{P O} \quad$ and $\quad D H_{2} \| P O$. From $\quad \overline{C H_{1}}=2 \overline{P O}=\overline{D H_{2}} \quad$ and $C H_{1}\|P O\| D H_{2}$ the quadrilateral $C H_{1} H_{2} D$ is a parallelogram, thus $\overline{H_{1} H_{2}}=\overline{C D}$ and $H_{1} H_{2} \| C D$. Therefore the area of the quadrilateral $A H_{1} B H_{2}$ is $\frac{\overline{A B} \cdot \overline{H_{1} H_{2}}}{2}=\frac{\overline{A B} \cdot \overline{C D}}{2}=S$. Solution 2. Since $M H_{1} \| D N$ and $N H_{1} \| D M, M D N H_{1}$ is a parallelogram. Similarly, $N H_{2} \| C M$ and $M H_{2} \| C N$ imply $M C N H_{2}$ is a parallelogram . Let $P$ be the midpoint of the segment $\overline{M N}$. Then $\sigma_{P}(D)=H_{1}$ and $\sigma_{P}(C)=H_{2}$, thus $C D \| H_{1} H_{2}$ and $\overline{C D}=\overline{H_{1} H_{2}}$. From $C D \perp A B$ we deduce $A_{A H_{1} B H_{2}}=\frac{1}{2} \overline{A B} \cdot \overline{C D}=S$. Problem 3. Let $a, b, c$ be positive real numbers such that $a b c=1$. Prove that $$ \left(a+\frac{1}{b}\right)^{2}+\left(b+\frac{1}{c}\right)^{2}+\left(c+\frac{1}{a}\right)^{2} \geq 3(a+b+c+1) $$ When does equality hold? Solution 1. By using AM-GM $\left(x^{2}+y^{2}+z^{2} \geq x y+y z+z x\right)$ we have $$ \begin{aligned} \left(a+\frac{1}{b}\right)^{2}+\left(b+\frac{1}{c}\right)^{2}+\left(c+\frac{1}{a}\right)^{2} & \geq\left(a+\frac{1}{b}\right)\left(b+\frac{1}{c}\right)+\left(b+\frac{1}{c}\right)\left(c+\frac{1}{a}\right)+\left(c+\frac{1}{a}\right)\left(a+\frac{1}{b}\right) \\ & =\left(a b+1+\frac{a}{c}+a\right)+\left(b c+1+\frac{b}{a}+b\right)+\left(c a+1+\frac{c}{b}+c\right) \\ & =a b+b c+c a+\frac{a}{c}+\frac{c}{b}+\frac{b}{a}+3+a+b+c \end{aligned} $$ Notice that by AM-GM we have $a b+\frac{b}{a} \geq 2 b, b c+\frac{c}{b} \geq 2 c$, and $c a+\frac{a}{c} \geq 2 a$. Thus , $\left(a+\frac{1}{b}\right)^{2}+\left(b+\frac{1}{c}\right)^{2}+\left(c+\frac{1}{a}\right)^{2} \geq\left(a b+\frac{b}{a}\right)+\left(b c+\frac{c}{b}\right)+\left(c a+\frac{a}{c}\right)+3+a+b+c \geq 3(a+b+c+1)$. The equality holds if and only if $a=b=c=1$. Solution 2. From QM-AM we obtain $$ \begin{gathered} \sqrt{\frac{\left(a+\frac{1}{b}\right)^{2}+\left(b+\frac{1}{c}\right)^{2}+\left(c+\frac{1}{a}\right)^{2}}{3}} \geq \frac{a+\frac{1}{b}+b+\frac{1}{c}+c+\frac{1}{a}}{3} \Leftrightarrow \\ \left(a+\frac{1}{b}\right)^{2}+\left(b+\frac{1}{c}\right)^{2}+\left(c+\frac{1}{a}\right)^{2} \end{gathered} \Leftrightarrow \frac{\left(a+\frac{1}{b}+b+\frac{1}{c}+c+\frac{1}{a}\right)^{2}}{3}(1) $$ From AM-GM we have $\frac{1}{a}+\frac{1}{b}+\frac{1}{c} \geq 3 \sqrt[3]{\frac{1}{a b c}}=3$, and substituting in (1) we get $$ \begin{aligned} & \left(a+\frac{1}{b}\right)^{2}+\left(b+\frac{1}{c}\right)^{2}+\left(c+\frac{1}{a}\right)^{2} \geq \frac{\left(a+\frac{1}{b}+b+\frac{1}{c}+c+\frac{1}{a}\right)^{2}}{3} \geq \frac{(a+b+c+3)^{2}}{3}= \\ & =\frac{(a+b+c)(a+b+c)+6(a+b+c)+9}{3} \geq \frac{(a+b+c) 3 \sqrt[3]{a b c}+6(a+b+c)+9}{3}= \\ & =\frac{9(a+b+c)+9}{3}=3(a+b+c+1) . \end{aligned} $$ The equality holds if and only if $a=b=c=1$. ## Solution 3. By using $x^{2}+y^{2}+z^{2} \geq x y+y z+z x$ $$ \begin{aligned} & \left(a+\frac{1}{b}\right)^{2}+\left(b+\frac{1}{c}\right)^{2}+\left(c+\frac{1}{a}\right)^{2}=a^{2}+b^{2}+c^{2}+\frac{1}{b^{2}}+\frac{1}{c^{2}}+\frac{1}{a^{2}}+\frac{2 a}{b}+\frac{2 b}{c}+\frac{2 c}{a} \geq \\ & \geq a b+a c+b c+\frac{1}{b c}+\frac{1}{c a}+\frac{1}{a b}+\frac{2 a}{b}+\frac{2 b}{c}+\frac{2 c}{a} \end{aligned} $$ Clearly $$ \begin{gathered} \frac{1}{b c}+\frac{1}{c a}+\frac{1}{a b}=\frac{a b c}{b c}+\frac{a b c}{c a}+\frac{a b c}{a b}=a+b+c \\ a b+\frac{a}{b}+b c+\frac{b}{c}+c a+\frac{c}{a} \geq 2 a+2 b+2 c \\ \frac{a}{b}+\frac{b}{c}+\frac{c}{a} \geq 3 \sqrt[3]{\frac{a}{b} \cdot \frac{b}{c} \cdot \frac{c}{a}}=3 \end{gathered} $$ Hence $$ \begin{aligned} & \left(a+\frac{1}{b}\right)^{2}+\left(b+\frac{1}{c}\right)^{2}+\left(c+\frac{1}{a}\right)^{2} \geq\left(a b+\frac{a}{b}\right)+\left(a c+\frac{c}{a}\right)+\left(b c+\frac{b}{c}\right)+a+b+c+\frac{a}{b}+\frac{b}{c}+\frac{c}{a} \geq \\ & \geq 2 a+2 b+2 c+a+b+c+3=3(a+b+c+1) \end{aligned} $$ The equality holds if and only if $a=b=c=1$. Solution 4. $a=\frac{x}{y}, b=\frac{y}{z}, c=\frac{z}{x}$ $$ \begin{aligned} & \left(\frac{x}{y}+\frac{z}{y}\right)^{2}+\left(\frac{y}{z}+\frac{x}{z}\right)^{2}+\left(\frac{z}{x}+\frac{y}{x}\right)^{2} \geq 3\left(\frac{x}{y}+\frac{y}{z}+\frac{z}{x}+1\right) \\ & (x+z)^{2} x^{2} z^{2}+(y+x)^{2} y^{2} x^{2}+(z+y)^{2} z^{2} y^{2} \geq 3 x y z\left(x^{2} z+y^{2} x+z^{2} y+x y z\right) \\ & x^{4} z^{2}+2 x^{3} z^{3}+x^{2} z^{4}+x^{2} y^{4}+2 x^{3} y^{3}+x^{4} y^{2}+y^{2} z^{4}+2 y^{3} z^{3}+y^{4} z^{2} \geq 3 x^{3} y z^{2}+3 x^{2} y^{3} z+3 x y^{2} z^{3}+3 x^{2} y^{2} z^{2} \\ & \text { 1) } x^{3} y^{3}+y^{3} z^{3}+z^{3} x^{3} \geq 3 x^{2} y^{2} z^{2} \\ & \text { 2) } x^{4} z^{2}+z^{4} x^{2}+x^{3} y^{3} \geq 3 x^{3} z^{2} y \\ & \text { 3) } x^{4} y^{2}+y^{4} x^{2}+y^{3} z^{3} \geq 3 y^{3} x^{2} z \\ & \text { 4) } z^{4} y^{2}+y^{4} z^{2}+x^{3} z^{3} \geq 3 z^{3} y^{2} x \end{aligned} $$ Equality holds when $x=y=z$, i.e., $a=b=c=1$. Solution 5. $\sum_{\text {cyc }}\left(a+\frac{1}{b}\right)^{2} \geq 3 \sum_{c y c} a+3$ $$ \begin{aligned} & \Leftrightarrow 2 \sum_{\text {cyc }} \frac{a}{b}+\sum_{\text {cyc }}\left(a^{2}+\frac{1}{a^{2}}-3 a-1\right) \geq 0 \\ & 2 \sum_{\text {cyc }} \frac{a}{b} \geq 6 \sqrt[3]{\frac{a}{b} \frac{b}{c} \frac{c}{a}}=6 \end{aligned} $$ $$ \begin{aligned} & \forall a>0, a^{2}+\frac{1}{a^{2}}-3 a \geq \frac{3}{a}-4 \\ & \Leftrightarrow a^{4}-3 a^{3}+4 a^{2}-3 a+1 \geq 0 \\ & \Leftrightarrow(a-1)^{2}\left(a^{2}-a+1\right) \geq 0 \\ & \sum_{\text {cyc }}\left(a^{2}+\frac{1}{a^{2}}-3 a-1\right) \geq 3 \sum_{\text {cyc }} \frac{1}{a}-15 \geq 9 \sqrt[3]{\frac{1}{a b c}}-15=-6 \end{aligned} $$ Using (1) and (2) we obtain $2 \sum_{\text {cyc }} \frac{a}{b}+\sum\left(a^{2}+\frac{1}{a^{2}}-3 a-1\right) \geq 6-6=0$ Equality holds when $a=b=c=1$. Problem 4. For a positive integer $n$, two players A and B play the following game: Given a pile of $s$ stones, the players take turn alternatively with A going first. On each turn the player is allowed to take either one stone, or a prime number of stones, or a multiple of $n$ stones. The winner is the one who takes the last stone. Assuming both $\mathrm{A}$ and $\mathrm{B}$ play perfectly, for how many values of $s$ the player A cannot win? Solution. Denote by $k$ the sought number and let $\left\{s_{1}, \mathrm{~s}_{2}, \ldots, \mathrm{s}_{k}\right\}$ be the corresponding values for $s$. We call each $s_{i}$ a losing number and every other nonnegative integer a winning numbers. ## Clearly every multiple of $n$ is a winning number. Suppose there are two different losing numbers $s_{i}>s_{j}$, which are congruent modulo $n$. Then, on his first turn of play, player $A$ may remove $s_{i}-s_{j}$ stones (since $n \mid s_{i}-s_{j}$ ), leaving a pile with $s_{j}$ stones for B. This is in contradiction with both $s_{i}$ and $s_{j}$ being losing numbers. Hence, there are at most $n-1$ losing numbers, i.e. $k \leq n-1$. Suppose there exists an integer $r \in\{1,2, \ldots, n-1\}$, such that $m n+r$ is a winning number for every $m \in \mathbb{N}_{0}$. Let us denote by $u$ the greatest losing number (if $k>0$ ) or 0 (if $k=0)$, and let $s=\operatorname{LCM}(2,3, \ldots, u+n+1)$. Note that all the numbers $s+2, s+3, \ldots$, $s+u+n+1 \quad$ are composite. Let $m^{\prime} \in \mathbb{N}_{0}$, be such that $s+u+2 \leq m^{\prime} n+r \leq s+u+n+1$. In order for $m^{\prime} n+r$ to be a winning number, there must exist an integer $p$, which is either one, or prime, or a positive multiple of $n$, such that $m^{\prime} n+r-p$ is a losing number or 0 , and hence lesser than or equal to $u$. Since $s+2 \leq m^{\prime} n+r-u \leq p \leq m^{\prime} n+r \leq s+u+n+1, p$ must be a composite, hence $p$ is a multiple of $n$ (say $p=q n$ ). But then $m^{\prime} n+r-p=\left(m^{\prime}-q\right) n+r$ must be a winning number, according to our assumption. This contradicts our assumption that all numbers $m n+r, m \in \mathbb{N}_{0}$ are winning. Hence, each nonzero residue class modulo $n$ contains a loosing number. There are exactly $n-1$ losing numbers . Lemma: No pair $(u, n)$ of positive integers satisfies the following property: $(*) \quad$ In $\mathbb{N}$ exists an arithmetic progression $\left(a_{t}\right)_{t=1}^{\infty}$ with difference $n$ such that each segment $\left[a_{i}-u, a_{i}+u\right]$ contains a prime. Proof of the lemma: Suppose such a pair $(u, n)$ and a corresponding arithmetic progression $\left(\mathrm{a}_{t}\right)_{t=1}^{\infty}$ exist. In $\mathbb{N}$ exist arbitrarily long patches of consecutive composites. Take such a patch $P$ of length $3 u n$. Then, at least one segment $\left[a_{i}-u, a_{i}+u\right]$ is fully contained in $P$, a contradiction. Suppose such a nonzero residue class modulo $n$ exists (hence $n>1$ ). Let $u \in \mathbb{N}$ be greater than every loosing number. Consider the members of the supposed residue class which are greater than $u$. They form an arithmetic progression with the property $\left({ }^{*}\right)$, a contradiction (by the lemma).