# Canadian Mathematical Olympiad 2021 ## Official Solutions ## A full list of our competition sponsors and partners is available online at https://cms.math.ca/competitions/competition-sponsors/ ## Note: Each problem starts on a new page. Problem No. 1. Let $A B C D$ be a trapezoid with $A B$ parallel to $C D,|A B|>|C D|$, and equal edges $|A D|=|B C|$. Let $I$ be the center of the circle tangent to lines $A B, A C$ and $B D$, where $A$ and $I$ are on opposite sides of $B D$. Let $J$ be the center of the circle tangent to lines $C D, A C$ and $B D$, where $D$ and $J$ are on opposite sides of $A C$. Prove that $|I C|=|J B|$. Solution. Let $\{P\}=A C \cap B D$ and let $\angle A P B=180-2 a$. Since $A B C D$ is an isosceles trapezoid, $A P B$ is an isosceles triangle. Therefore $\angle P B A=a$, which implies that $\angle P B I=90^{\circ}-a / 2$ since $I$ lies on the external bisector of $\angle P B A$. Since $I$ lies on the bisector of $\angle C P B$, it follows that $\angle B P I=a$ and hence that $I P B$ is isosceles with $|I P|=|P B|$. Similarly $J P C$ is isosceles with $|J P|=|P C|$. So, in the triangles $C P I$ and $B P J$ we have $P I \equiv P B$ and $P J \equiv C P$. Since $I$ and $J$ both lie on the internal bisector of $\angle B P C$, it follows that triangles $C P I$ and $B P J$ are congruent. Therefore $|I C|=|J B|$. A competition of the Canadian Mathematical Society and supported by the Actuarial Profession. ![](https://cdn.mathpix.com/cropped/2024_11_22_6804b549993495e6e39fg-1.jpg?height=338&width=764&top_left_y=2086&top_left_x=626) Expertise. Insight. Solutions. ## Canadian Mathematical Olympiad 2021 ## Problem No. 2. Let $n \geq 2$ be some fixed positive integer and suppose that $a_{1}, a_{2}, \ldots, a_{n}$ are positive real numbers satisfying $a_{1}+a_{2}+\cdots+a_{n}=2^{n}-1$. Find the minimum possible value of $$ \frac{a_{1}}{1}+\frac{a_{2}}{1+a_{1}}+\frac{a_{3}}{1+a_{1}+a_{2}}+\cdots+\frac{a_{n}}{1+a_{1}+a_{2}+\cdots+a_{n-1}} . $$ Solution. We claim the the minimum possible value of this expression is $n$. Observe that by AM-GM, we have that $$ \begin{aligned} \frac{a_{1}}{1}+ & \frac{a_{2}}{1+a_{1}}+\cdots+\frac{a_{n}}{1+a_{1}+a_{2}+\cdots+a_{n-1}} \\ & =\frac{1+a_{1}}{1}+\frac{1+a_{1}+a_{2}}{1+a_{1}}+\cdots+\frac{1+a_{1}+a_{2}+\cdots+a_{n}}{1+a_{1}+a_{2}+\cdots+a_{n-1}}-n \\ & \geq n \cdot \sqrt[n]{\frac{1+a_{1}}{1} \cdot \frac{1+a_{1}+a_{2}}{1+a_{1}} \cdots \frac{1+a_{1}+a_{2}+\cdots+a_{n}}{1+a_{1}+a_{2}+\cdots+a_{n-1}}}-n \\ & =n \cdot \sqrt[n]{1+a_{1}+a_{2}+\cdots+a_{n}}-n \\ & =2 n-n=n . \end{aligned} $$ Furthermore, equality is achieved when $a_{k}=2^{k-1}$ for each $1 \leq k \leq n$. ## Canadian Mathematical Olympiad 2021 ## Problem No. 3. At a dinner party there are $N$ hosts and $N$ guests, seated around a circular table, where $N \geq 4$. A pair of two guests will chat with one another if either there is at most one person seated between them or if there are exactly two people between them, at least one of whom is a host. Prove that no matter how the 2 N people are seated at the dinner party, at least $N$ pairs of guests will chat with one another. Solution. Let a run refer to a maximal group of consecutive dinner party guests all of whom are the same type (host or guest). Suppose that there are exactly $k$ runs of hosts and $k$ runs of guests. Let $G_{i}$ and $H_{i}$ denote the number of runs of guests and hosts, respectively, of length exactly $i$. Furthermore, let $X$ denote the number of hosts surrounded by two runs of guests, both of length exactly 1 . We claim that the number of pairs of guests who chat is at least $$ 2 N-3 k+G_{1}+2 H_{1}+H_{2}-X $$ The number of pairs of guests who chat with no host between them is at least the sum of $\max \{2 \ell-3,0\}$ over all guest run lengths $\ell$. This sum is at least $2 N-3 k+G_{1}$. The number of pairs of guests who chat with exactly two hosts between them is $H_{2}$. Furthermore, the number of pairs of guests who chat with exactly one host between them is at least $2 H_{1}-X$. This is because any host surrounded by two runs of guests causes at least two pairs of guests to chat unless these runs are both of length exactly 1 . This proves the claim. Now note that $$ 2 H_{1}+H_{2}+N \geq 3 k $$ because each run of hosts contributes at least three to the left hand side. Furthermore, pairing each run counted in $X$ with the guest run of length 1 immediately following it in clockwise order shows that $G_{1} \geq X$. Combining these inequalities yields that $2 N-3 k+G_{1}+2 H_{1}+H_{2}-X \geq N$, completing the proof of the desired result. ## Canadian Mathematical Olympiad 2021 ## Problem No. 4. A function $f$ from the positive integers to the positive integers is called Canadian if it satisfies $$ \operatorname{gcd}(f(f(x)), f(x+y))=\operatorname{gcd}(x, y) $$ for all pairs of positive integers $x$ and $y$. Find all positive integers $m$ such that $f(m)=m$ for all Canadian functions $f$. Solution. Define an $m \in \mathbb{N}$ to be good if $f(m)=m$ for all such $f$. It will be shown that $m$ is good if and only if $m$ has two or more distinct prime divisors. Let $P(x, y)$ denote the assertion $$ \operatorname{gcd}(f(f(x)), f(x+y))=\operatorname{gcd}(x, y) $$ for a pair $x, y \in \mathbb{N}$. Let $x$ be a positive integer with two or more distinct prime divisors and let $p^{k}$ be largest power of one of these prime divisors such that $p^{k} \mid x$. If $x=p^{k} \cdot q$, then $p^{k}$ and $q$ are relatively prime and $x>p^{k}, q>1$. By $P(q, x-q)$, $$ \operatorname{gcd}(f(f(q)), f(x-q+q))=\operatorname{gcd}(f(f(q)), f(x))=\operatorname{gcd}(q, x-q)=q $$ which implies that $q \mid f(x)$. By $P\left(p^{k}, x-p^{k}\right)$, $$ \operatorname{gcd}\left(f\left(f\left(p^{k}\right)\right), f\left(x-p^{k}+p^{k}\right)\right)=\operatorname{gcd}\left(f\left(f\left(p^{k}\right)\right), f(x)\right)=\operatorname{gcd}\left(p^{k}, x-p^{k}\right)=p^{k} $$ which implies that $p^{k} \mid f(x)$. Since $p^{k}$ and $q$ are relatively prime, $x=p^{k} \cdot q$ divides $f(x)$, which implies that $f(x) \geq x$. Now assume for contradiction that $f(x)>x$. Let $y=f(x)-x>0$ and note that, by $P(x, y)$, it follows that $$ f(f(x))=\operatorname{gcd}(f(f(x)), f(x+f(x)-x))=\operatorname{gcd}(x, f(x)-x)=\operatorname{gcd}(x, f(x)) . $$ Therefore $f(f(x)) \mid x$ and $f(f(x)) \mid f(x)$. By $P(x, x)$, it follows that $$ \operatorname{gcd}(f(f(x)), f(2 x))=\operatorname{gcd}(x, x)=x $$ This implies that $x \mid f(f(x))$, which when combined with the above result, yields that $f(f(x))=x$. Since $x \mid f(x)$ and $x$ is divisible by at least two distinct prime numbers, $f(x)$ is also divisible by at least two distinct prime numbers. As shown previously, this implies that $f(x) \mid f(f(x))=x$, which is a contradiction since $f(x)>x$. Therefore $f(x)=x$ for all positive integers $x$ with two or more distinct prime divisors. Now it will be shown that all $m \in \mathbb{N}$ such that either $m$ has one prime divisor or $m=1$ are not good. In either case, let $m=p^{k}$ where $k \geq 0$ and $p$ is a prime number and consider the function satisfying that $f\left(p^{k}\right)=p^{k+1}, f\left(p^{k+1}\right)=p^{k}$ and $f(x)=x$ for all $x \neq p^{k}, p^{k+1}$. Note that this function also satisfies that $f(f(x))=x$ for all positive integers $x$. If $x+y \neq p^{k}, p^{k+1}$, then $P(x, y)$ holds by the Euclidean ## Canadian Mathematical Olympiad 2021 algorithm since $f\left(f((x))=x\right.$ and $f(x+y)=x+y$. If $x+y=p^{k+1}$, then $P(x, y)$ is equivalent to $\operatorname{gcd}\left(x, p^{k}\right)=\operatorname{gcd}\left(x, p^{k+1}-x\right)=\operatorname{gcd}\left(x, p^{k+1}\right)$ for all $xz$, as desired. Case 2. At least two carries: $x+y$ and $x+z$ carry and $d_{\ell+1}(y)=d_{\ell+1}(z)=0$, or cyclic equivalent. ( $y+z$ may or may not carry.) Let $i$ be maximal such that $d_{\ell+1}(x)=\cdots=d_{\ell+i}(x)=1$ (possibly $i=0$ ). By maximality of $\ell, d_{\ell+1}(y)=$ $\cdots=d_{\ell+i}(y)=d_{\ell+1}(z)=\cdots=d_{\ell+i}(z)=0$. By maximality of $i, d_{\ell+i+1}(x)=0$. If $d_{\ell+i+1}(y)=d_{\ell+i+1}(z)=0$, then $d_{\ell+i+1}(x+y)=d_{\ell+i+1}(x+z)=1$, so $d_{\ell+i+1}\left(x^{\prime}\right)=1$. The binary representations of $x$ and $x^{\prime}$ agree to the left of the $2^{\ell+i+1}$ position, so $x^{\prime}>x$. ## Canadian Mathematical Olympiad 2021 Otherwise, WLOG $d_{\ell+i+1}(y)=1$ and $d_{\ell+i+1}(z)=0$. (Note that, here we in fact have $i \geq 1$.) Then $d_{\ell+i+1}(y+z)=d_{\ell+i+1}(x+z)=1$, so $d_{\ell+i+1}\left(z^{\prime}\right)=1$. The binary representations of $z$ and $z^{\prime}$ agree to the left of the $2^{\ell+i+1}$ position, so $z^{\prime}>z$. Case 3. At least two carries, and the condition in Case 2 does not occur. WLOG let $x+y, x+z$ involve carries. Since the condition in Case 2 does not occur, $d_{\ell+1}(y)=1$ or $d_{\ell+1}(z)=1$. In either case, $d_{\ell+1}(x)=0$. WLOG $d_{\ell+1}(y)=1$ and $d_{\ell+1}(z)=0$. Since the condition in Case 2 does not occur, $y+z$ does not involve a carry from the $2^{\ell}$ position. (Otherwise, $x+y$ and $y+z$ carry and $d_{\ell+1}(x)=d_{\ell+1}(z)=0$.) Then $d_{\ell+1}(x+z)=d_{\ell+1}(y+z)=1$, so $d_{\ell+1}\left(z^{\prime}\right)=1$. The binary representations of $z$ and $z^{\prime}$ agree to the left of the $2^{\ell+1}$ position, so $z^{\prime}>z$. Proof of Claim 1. Proceed by strong induction on $x+y+z$. There is no base case. Suppose by induction the claim holds for all $(x, y, z)$ with sum less than $N$. Consider a triple $(x, y, z)$ with $x+y+z=N$. Suppose no two of $x, y, z$ overlap. If all moves from this position lead to positions with a negative coordinate, $(x, y, z)$ is a losing position, as claimed. Otherwise, the player increases or decreases all coordinates by $k$. Consider the smallest $m$ such that $d_{m}(k)=1$. The player's move will toggle each of $d_{m}(x), d_{m}(y), d_{m}(z)$. Since at most one of the original $d_{m}(x), d_{m}(y), d_{m}(z)$ is 1 , at least two of the new $d_{m}(x), d_{m}(y), d_{m}(z)$ will be 1 . So, two of the new $x, y, z$ overlap. By induction, the new $(x, y, z)$ is winning. Thus the original $(x, y, z)$ is losing, as claimed. Conversely, suppose at least one pair of $x, y, z$ overlap. By Lemma 1, at least one of $x