# Problem T-1 Given a pair $\left(a_{0}, b_{0}\right)$ of real numbers, we define two sequences $a_{0}, a_{1}, a_{2}, \ldots$ and $b_{0}, b_{1}, b_{2}, \ldots$ of real numbers by $$ a_{n+1}=a_{n}+b_{n} \quad \text { and } \quad b_{n+1}=a_{n} \cdot b_{n} $$ for all $n=0,1,2, \ldots$ Find all pairs $\left(a_{0}, b_{0}\right)$ of real numbers such that $a_{2022}=a_{0}$ and $b_{2022}=b_{0}$. Answer: All pairs $\left(a_{0}, b_{0}\right)$ where $b_{0}=0$ and $a_{0}$ is arbitrary. Solution. Consider a function $\Phi$ of two real variables defined by $\Phi(a, b)=(a-1)^{2}+(b-1)^{2}$. We claim that $\Phi\left(a_{n+1}, b_{n+1}\right) \geq \Phi\left(a_{n}, b_{n}\right)$ for all $n$, with equality if and only if $a_{n} b_{n}=0$. Indeed, setting $a_{n}=a$ and $b_{n}=b$ we verify $$ \Phi\left(a_{n+1}, b_{n+1}\right)-\Phi\left(a_{n}, b_{n}\right)=(a b-1)^{2}+(a+b-1)^{2}-(a-1)^{2}-(b-1)^{2}=(a b)^{2} \geq 0 $$ This means that $$ \Phi\left(a_{2022}, b_{2022}\right) \geq \Phi\left(a_{2021}, b_{2021}\right) \geq \cdots \geq \Phi\left(a_{0}, b_{0}\right) $$ so equalities must occur everywhere. We distinguish two cases: (a) If $b_{0}=0$ then $a_{i}=a_{0}$ and $b_{i}=0$ for all $i=1, \ldots, 2022$ and we get a valid solution for arbitrary real number $a_{0}$. (b) If $b_{0} \neq 0$ then from $\left(a_{0} b_{0}\right)^{2}=0$ we infer $a_{0}=0$. Thus $a_{1}=b_{0} \neq 0, b_{1}=0$ and from this point on $a_{i}=b_{0}, b_{i}=0$ for all $i=1, \ldots, 2022$. Hence we do not get any solution here. Remark. Other functions work too. For example a function $\Phi_{2}$ defined by $$ \Phi_{2}(a, b)=a^{2}-2 a-2 b $$ gives an even slightly more convenient $\Phi\left(a_{n+1}, b_{n+1}\right) \geq \Phi\left(a_{n}, b_{n}\right)$ with equality if and only if $b_{n}=0$. Alternative solution. Since $$ a_{n+2}-a_{n+1}=b_{n+1}=a_{n} b_{n}=a_{n}\left(a_{n+1}-a_{n}\right)=a_{n} a_{n+1}-a_{n}^{2} $$ we can write $$ \sum_{n}\left(a_{n+1}-a_{n}\right)^{2}=2 \sum_{n} a_{n}^{2}-2 \sum_{n} a_{n+1} a_{n}=-2 \sum_{n}\left(a_{n} a_{n+1}-a_{n}^{2}\right)=-2 \sum_{n}\left(a_{n+2}-a_{n+1}\right)=0 $$ thus $a_{n}=a_{n+1}=a_{n}+b_{n}$ and $b_{n}=0$ for all $n$. ![](https://cdn.mathpix.com/cropped/2024_06_05_45ecadfb6afd1a68901ag-02.jpg?height=257&width=237&top_left_y=109&top_left_x=224) Team Competition - Solutions ## Problem T-2 Let $k$ be a positive integer and $a_{1}, a_{2}, \ldots, a_{k}$ be nonnegative real numbers. Initially, there is a sequence of $n \geq k$ zeros written on a blackboard. At each step, Nicole chooses $k$ consecutive numbers written on the blackboard and increases the first number by $a_{1}$, the second one by $a_{2}$, and so on, until she increases the $k$-th one by $a_{k}$. After a positive number of steps, Nicole managed to make all the numbers on the blackboard equal. Prove that all the nonzero numbers among $a_{1}, a_{2}, \ldots, a_{k}$ are equal. Solution. Denote by $L_{i}, 0 \leq i0$. Focusing now at the $k$ th number in John's sequence, we get $K=L_{0} a_{k-1}+\cdots+L_{i} a_{k-1-i}+\ldots$. But $L_{0} a_{k-1}=p a=K$, so we are getting $L_{i} a_{k-1-i}=0$, hence $a_{k-1-i}=0$. We can apply exactly the same argument on the other side (replace $L_{j}$ with $R_{n-1-j}$ and $a_{j}$ with $a_{k-1-j}$ and eq. (1) with eq. (2)). We get that whenever $a_{k-1-i}0$, implying $L_{0}>0$. We normalize the sequence by dividing each term by $a_{0}$, so that $a_{0}=1$ and all numbers on the board are equal to $L_{0}$ in the end. Claim. All terms of the sequence are now rational numbers. Proof. Assume the contrary. Consider the smallest index $i$ with $a_{i} \notin \mathbb{Q}$ and look at the $i$-th number on the board which in the end of the process takes the value $L_{0} \in \mathbb{N}$. Since $a_{i}$ was added to this position $L_{0}$ times and all other terms added to it must have been rational by minimality of $i$, we get a contradiction. If there now exists some index $j$ with $0v_{q}\left(L_{s} \cdot a_{t}\right)$. Hence, $$ v_{q}\left(L_{0} \cdot a_{0}\right)>v_{q}\left(L_{s} \cdot a_{t}\right)=v_{q}\left(\sum_{i=0}^{s+t} L_{i} \cdot a_{s+t-i}\right) $$ contradiction. We conclude that no such $j$ could have existed, so all terms are either equal to 0 or $a_{0}$. Solution using Polynomials. By the claim of the previous solution, we see that we may assume all terms of the sequence to be nonnegative integers (just multiply everything by the lcm of the denominators). Again, we note that for all $i$, it holds that $a_{0} \geq a_{i}$. Now observe the polynomial $$ P(x)=\sum_{i=0}^{k-1} a_{i} x^{i} $$ and interpret the numbers on the board as a polynomial in a similar way, i.e. if the numbers on the board are $b_{0}, \ldots, b_{n-1}$, read it as $$ \sum_{i=0}^{n-1} b_{i} x^{i} $$ The problem states that after each step, the polynomial on the board is increased by $x^{p} \cdot P(x)$ for some $p \in \mathbb{N}_{0}$. Therefore, the condition can be rewritten as $$ P(x) \cdot Q(x)=K \cdot \frac{x^{n}-1}{x-1} $$ for some polynomial $Q \in \mathbb{Z}[x]$ and $K \in \mathbb{N}$. It follows that $$ P(x)=a \cdot R(x) $$ where $a \mid K$ and $R(x) \left\lvert\, \frac{x^{n}-1}{x-1}\right.$. We see that the constant term of $R$ must be equal to 1 , and so $a_{0}=a$. As $a \mid a_{i}$ and $a_{0} \geq a_{i}$ for all $i$, they are indeed all equal to $a$. ![](https://cdn.mathpix.com/cropped/2024_06_05_45ecadfb6afd1a68901ag-05.jpg?height=257&width=237&top_left_y=109&top_left_x=224) ## Problem T-3 Let $n$ be a positive integer. There are $n$ purple and $n$ white cows queuing in a line in some order. Tim wishes to sort the cows by colour, such that all purple cows are at the front of the line. At each step, he is only allowed to swap two adjacent groups of equally many consecutive cows. What is the minimal number of steps Tim needs to be able to fulfill his wish, regardless of the initial alignment of the cows? Example. For instance, Tim can perform the following three swaps: $$ W \underline{P W} \overline{P P} W \longrightarrow \underline{W} \bar{P} P P W W \longrightarrow P \underline{W P} \overline{P W} W \longrightarrow P P W W P W $$ Answer: Tim needs at most $n$ swaps. Solution. Imagine that the queue has an additional immovable purple cow in front of all other cows and an additional immovable white cow behind all other cows; he can only do swaps that do not displace these two. We will now consider the variable of "the number of pairs of adjacent equally coloured cows". For example, if the queue is $$ \overline{\mathrm{P}} P W \overline{P P} \underline{W} \overline{W W} P \underline{\mathrm{W}} $$ we have 4 different such pairs, including the two immovable cows at the start and end in our queue. Now, note that when Tim makes a swap, he changes three pairs - the one preceding the first block; the one between the two blocks and the one after the second block. $$ \begin{aligned} & \ldots x_{1} \underline{y_{1} \ldots x_{2}} \frac{y_{2} \ldots x_{3}}{\downarrow} y_{3} \ldots \\ & \ldots x_{1} \underline{y_{2} \ldots x_{3}} \underline{y_{1} \ldots x_{2}} y_{3} \ldots \end{aligned} $$ It is not hard to see that the maximum increase in the number of such pairs is 2 ; it is impossible to go from all three of them being unequal to all three being equal. In the worst-case initial scenario, which consists of an alternating sequence beginning with a $W$, there are no adjacent equal pairs, and the final state contains $2 n$ adjacent equal pairs (again taking into account the two immovable cows). This establishes $n$ as a lower bound. Finally, we iteratively prove that $n$ is always sufficient with the induction hypothesis that we can always attain the sorted queue as well as the reversed queue within $n$ moves. This is trivially true for $n=1$. Now, suppose it holds true up to $k$, and consider the case $k+1$ (disregarding the immovable cows, which we do not need anymore). - If the cow in front is purple and the last cow is white, just sort the inner queue of length $2 k$ with $k$ moves. - If the first cow is white and the last cow is purple, sort the inner queue in reverse (in $k$ moves) and then do one final swap on the large blocks white and purple cows. - If the first and the last cow have the same colour, use one initial swap to get a purple cow at the start and a white cow at the end. This is certainly possible because if both are white, there must be a purple cow in the front half of the queue, so we can swap the block from the first cow until right before that white cow with the subsequent block of the same length; this does not modify the end of the queue. If both are purple, a symmetric argument allows swapping a white cow to the end without modifying the start. Then sort the inner queue with $k$ moves. By symmetry, we could also have sorted to the reverse queue within $k+1$ moves. Thus we have proved the inductive step and are done. ![](https://cdn.mathpix.com/cropped/2024_06_05_45ecadfb6afd1a68901ag-07.jpg?height=257&width=237&top_left_y=109&top_left_x=224) ## Problem T-4 Let $n$ be a positive integer. We are given a $2 n \times 2 n$ table. Each cell is coloured with one of $2 n^{2}$ colours such that each colour is used exactly twice. Jana stands in one of the cells. There is a chocolate bar lying in one of the other cells. Jana wishes to reach the cell with the chocolate bar. At each step, she can only move in one of the following two ways. Either she walks to an adjacent cell or she teleports to the other cell with the same colour as her current cell. (Jana can move to an adjacent cell of the same colour by either walking or teleporting.) Determine whether Jana can fulfill her wish, regardless of the initial configuration, if she has to alternate between the two ways of moving and has to start with a teleportation. Remark. Two cells are adjacent if they share a common edge. Answer: Jana can always reach the chocolate. Solution. Fix the colouring of the cells and the starting position. We prove that Jana can reach any cell. Call a series of moves legal, if she starts from the starting cell with a teleport move, and uses the two types of moves alternately. Divide the cells into four categories. - Call a cell teleport reachable, if Jana can make a legal series of moves finishing in this cell, but all such legal movement ends with a teleport move. - Call a cell adjacent reachable, if Jana can make a legal series of moves finishing in this cell, but all such legal movement ends with an adjacent move. - Call a cell easily reachable if it can be reached legally such that the last move is a teleportation, and also it can be reached with the last move being an adjacent move. - Finally, call a cell unreachable, if Jana cannot move to this cell with a legal movement. For consistency, we assume the cell that Jane starts on to be reachable with an adjacent move that happened before the start of the game and forces Jane to perform a teleport move next. The starting cell therefore is either adjacent reachable or easily reachable. Also, for any given cell, we call the other cell with the same colour its "partner cell". Lemma. The number of teleport reachable cells and adjacent reachable cells must be the same. Proof. Consider a cell $T$ and its partner cell $T^{\prime}$. If $T$ is easily reachable, so is $T^{\prime}$ (as any move before teleporting from $T^{\prime}$ to $T$ must be an adjacent move to $T^{\prime}$ and any adjacent move to $T$ can be extended by a teleport to $T^{\prime}$ ). Similarly, if $T$ is teleport reachable, $T^{\prime}$ must be adjacent reachable and vice versa. If $T$ is unreachable, so is $T^{\prime}$, otherwise it would contradict the previous observations. Each pair therefore contributes equally many adjacent and teleport reachable cells. Lemma. Each neighbour $N$ of a teleport reachable cell $T$ must be adjacent reachable. Proof. A legal movement to $T$ can be extended with an adjacent move to $N$. But if $N$ was easily reachable, we could extend a teleport movement to $N$ with an adjacent move to $T$, so $T$ would be easily reachable too. Lemma. Neighbours of easily reachable cells are never unreachable. Proof. At the very least we could extend a teleport movement to the easily reachable cell with an adjacent move. Assume that there exist one or more unreachable cells. Then somewhere on the board, there are two adjacent cells of which one is unreachable and the other is not. By the second and third lemma, this neighbour cell can neither be easily reachable nor teleport reachable, so it must be adjacent reachable. Put a domino covering these two cells, and tile the whole table with dominoes containing this domino. Clearly, we can do this: Extend the two short sides of the domino such the sides of the domino now partition the board into four rectangular regions. Since each of those rectangles have at least one even dimension, we can cover them by dominoes. Now by the second lemma, every domino that contains a teleport reachable cell must contain an adjacent reachable cell, and there is a domino that contains an adjacent reachable cell with no teleport reachable cell. This is a contradiction, as the number of teleport reachable cells and adjacent reachable cells are the same by the first lemma. ## Problem T-5 Let $\Omega$ be the circumcircle of a triangle $A B C$ with $\angle C A B=90^{\circ}$. The medians through $B$ and $C$ meet $\Omega$ again at $D$ and $E$, respectively. The tangent to $\Omega$ at $D$ intersects the line $A C$ at $X$ and the tangent to $\Omega$ at $E$ intersects the line $A B$ at $Y$. Prove that the line $X Y$ is tangent to $\Omega$. Solution. Let $G$ be the second intersection of the median through $A$ and $\Omega$. We will show that $X Y$ is tangent to $\Omega$ at $G$. Let $X^{\prime}$ be the intersection of the tangents to $\Omega$ at $D$ and $G$. We claim that $A, C$, and $X^{\prime}$ are collinear. ![](https://cdn.mathpix.com/cropped/2024_06_05_45ecadfb6afd1a68901ag-09.jpg?height=569&width=805&top_left_y=949&top_left_x=680) Let $O$ be the center of $\Omega$, and $M$ the midpoint of $A C$. We start by noting that $$ \angle G O X^{\prime}=\frac{1}{2} \angle G O D=\angle G B D=\angle A M B $$ where we used that $A C \| B G$ in the last equality. Hence, $\triangle M A B \sim \triangle O G X^{\prime}$, in particular $\frac{X^{\prime} G}{O G}=\frac{B A}{A M}$. As $A C=2 \cdot A M$ and $A G=2 \cdot O G$, we also have $\triangle C A B \sim A G X^{\prime}$. In particular, $\angle G A X^{\prime}=\angle A C B=\angle G A C$, proving the claim. Hence $X=X^{\prime}$, so that the tangent at $G$ contains $X$, and by symmetry, $Y$. ![](https://cdn.mathpix.com/cropped/2024_06_05_45ecadfb6afd1a68901ag-09.jpg?height=509&width=803&top_left_y=1987&top_left_x=678) ![](https://cdn.mathpix.com/cropped/2024_06_05_45ecadfb6afd1a68901ag-10.jpg?height=252&width=237&top_left_y=111&top_left_x=224) Team Competition - Solutions MEMO 2022 Bern English version ## Problem T-6 Let $A B C D$ be a convex quadrilateral such that $A C=B D$ and the sides $A B$ and $C D$ are not parallel. Let $P$ be the intersection point of the diagonals $A C$ and $B D$. Points $E$ and $F$ lie, respectively, on segments $B P$ and $A P$ such that $P C=P E$ and $P D=P F$. Prove that the circumcircle of the triangle determined by the lines $A B, C D$ and $E F$ is tangent to the circumcircle of the triangle $A B P$. Solution. Without loss of generality assume that $A Pf(n-1)+(n-1)+1$ for all $n>1$. In other words, the sequence $\left(b_{n}\right)_{n}$ is a strictly increasing sequence of positive integers. Since $b_{1} \geq 2$, we have $b_{n} \geq n+1$, or, in other words, $f(n) \geq n^{2}+n$ for every $n \geq 1$. Consider some $n \geq 1$. We have $f(f(n))+f(n)+1=j^{2}$ for some integer $j$ from the condition of the problem applied to $f(n)$. Also $f(f(n))-f(n)=k^{2}$ for some integer $k$. Clearly $kk$, we have $j \geq k+1$ and hence $j-k \geq 1, j+k \geq 2 k+1$. Combining these inequalities with the previous equation yield $2 f(n)+1 \geq 2 k+1$ and therefore $k \leq f(n)$. This means that $f(f(n))-f(n) \leq f(n)^{2}$. Combining the two results we obtain that $f(f(n))=f(n)^{2}+f(n)$ for all $n$. Moreover by the problem conditions $b_{n}:=\sqrt{f(n)+n+1}$ is a strictly increasing sequence of integers such that $b_{n} \geq n+1$ and $b_{f(n)}=f(n)+1$ for all $n$. Therefore we must have that $b_{n}=n+1$ for all $n$ and hence $f(n)=n^{2}+n$ for all $n$. We verify easily that this function verify the conditions of the problem. Comment. The condition ' $f(f(n))-f(n)$ is a square' can be replaced by any condition of the form ' $f\left(c_{n}\right)-c_{n}$ is a square'. where $\left(c_{n}\right)_{n}$ is any unbounded sequence. The same solution applies. ## Problem T-8 We call a positive integer cheesy if we can obtain the average of the digits in its decimal representation by putting a decimal separator after the leftmost digit. Prove that there are only finitely many cheesy numbers. Example. For instance, 2250 is cheesy, as the average of the digits is 2.250 . Solution. Let $n$ be a positive integer and $k$ be the number of digits of $n$. Let $m$ be the sum of digits of $n$. We prove that if $k \geq 2^{6}$ then $n$ is not reflexive. Let $a=v_{2}(k)$ be the nonnegative integer such that $2^{a} \leq k<2^{a+1}$. It is easy to see that $n$ is reflexive exactly if $$ m \cdot 10^{k-1}=n k $$ Suppose by contradiction that $n$ is reflexive and $k \geq 2^{6}$. The left handside is divisible by $10^{k-1}$ and $k<2^{a+1}$, and also from this trivially $k<5^{a+1}$, so $2^{a+1}$ and $5^{a+1}$ do not divide $k$, which means $10^{k-1-a} \mid n$. Hence the last $k-1-a$ digits of $n$ is 0 , so only the first $a+1$ digits can be nonzero, thus $m \leq 9(a+1)$. Also $n \geq 10^{k-1}$ as $n$ has $k$ digits. It is easy to prove that $9(A+1)<2^{A}$ if $A \geq 6$. Combining these $$ m \cdot 10^{k-1} \leq 9(a+1) \cdot 10^{k-1}<10^{k-1} \cdot 2^{a} \leq n k $$ which is a contradiction.