problem: Let $\leftarrow$ denote the left arrow key on a standard keyboard. If one opens a text editor and types the keys "ab $\leftarrow \mathrm{cd} \leftarrow \leftarrow \mathrm{e} \leftarrow \leftarrow \mathrm{f}$ ", the result is "faecdb". We say that a string $B$ is reachable from a string $A$ if it is possible to insert some amount of $\leftarrow$ 's in $A$, such that typing the resulting characters produces $B$. So, our example shows that "faecdb" is reachable from "abcdef".  Prove that for any two strings $A$ and $B, A$ is reachable from $B$ if and only if $B$ is reachable from $A$.

solution: Obviously $A$ and $B$ should have the same multiset of characters, and we focus only on that situation.  Claim - If $A=123 \ldots n$ and $B=\sigma(1) \sigma(2) \ldots \sigma(n)$ is a permutation of $A$, then $B$ is reachable if and only if it is $\mathbf{2 1 3}$-avoiding, i.e. there are no indices $i<j<k$ such that $\sigma(j)<\sigma(i)<\sigma(k)$.   Claim - A permutation $\sigma$ on $\{1, \ldots, n\}$ is 213 -avoiding if and only if the inverse $\sigma^{-1}$ is.   This essentially finishes the problem. Suppose $B$ is reachable from $A$. By using the typing pattern, we get some permutation $\sigma:\{1, \ldots, n\}$ such that the $i$ th character of $A$ is the $\sigma(i)$ th character of $B$, and which is 213 -avoiding by the claim. (The permutation is unique if $A$ has all distinct characters, but there could be multiple if $A$ has repeated ones.) Then $\sigma^{-1}$ is 213 -avoiding too and gives us a way to change $B$ into $A$.


problem: Consider a convex pentagon circumscribed about a circle. We name the lines that connect vertices of the pentagon with the opposite points of tangency with the circle gergonnians. (a) Prove that if four gergonnians are concurrent, then all five of them are concurrent. (b) Prove that if there is a triple of gergonnians that are concurrent, then there is another triple of gergonnians that are concurrent.

solution: This problem is insta-killed by taking a homography sending the concurrency point (in either part) to the center of the circle while fixing the incircle. Alternatively, one may send any four of the tangency points to a rectangle. Here are the details. Let $A B C D E$ be a pentagon with gergonnians $\overline{A V}, \overline{B W}, \overline{C X}$, $\overline{D Y}, \overline{E Z}$. We prove the following lemma, which (up to a suitable permutation of point names) solves both parts (a) and (b).  ## Lemma  The gergonnians $\overline{A V}, \overline{C X}, \overline{D Y}$ are concurrent if and only if the gergonnians $\overline{A V}$, $\overline{B W}, \overline{E Z}$ are concurrent.  ![](https://cdn.mathpix.com/cropped/2024_11_19_ac2bed8de28bd21d9c6dg-4.jpg?height=492&width=706&top_left_y=1736&top_left_x=681)  Then $X$ and $Y$ are symmetric around $\overline{A P V}$ by hypothesis. Since $D=\overline{V V} \cap \overline{P Y}$, $C=\overline{V V} \cap \overline{P X}$, it follows that $C$ and $D$, and hence $Z$ and $W$, are also symmetric around $\overline{A P V}$. Consequently $B$ and $E$ are symmetric too. So $\overline{B W}$ and $\overline{E Z}$ meet on $\overline{A V}$.


problem: Find all polynomials $P(x)$ with real coefficients that satisfy  $$ P(x \sqrt{2})=P\left(x+\sqrt{1-x^{2}}\right) $$  for all real numbers $x$ with $|x| \leq 1$.

solution: The answer is any polynomial of the form $P(x)=f(U(x / \sqrt{2}))$, where $f \in \mathbb{R}[x]$ and $U$ is the unique polynomial satisfying $U(\cos \theta)=\cos (8 \theta)$.  Let $Q(x)=P(x \sqrt{2})$, then the condition reads  $$ Q(\cos \theta)=Q\left(\frac{1}{\sqrt{2}}(\cos \theta+\sin \theta)\right)=Q\left(\cos \left(\theta-45^{\circ}\right)\right) \quad \forall 0 \leq \theta \leq 180^{\circ} . $$  We call a polynomial good if it satisfies this functional equation.  ## Lemma  The minimal (by degree) good nonconstant polynomial is $U$.   $$ \begin{aligned} Q\left(\cos 136^{\circ}\right) & =Q\left(\cos 91^{\circ}\right)=Q\left(\cos 46^{\circ}\right)=Q\left(\cos 1^{\circ}\right)=Q\left(\cos -44^{\circ}\right) \\ & =Q\left(\cos 44^{\circ}\right)=Q\left(\cos 89^{\circ}\right)=Q\left(\cos 134^{\circ}\right)=Q\left(\cos 179^{\circ}\right) \end{aligned} $$  Hence $Q$ is equal at eight distinct values (not nine since $\cos -44^{\circ}=\cos 44^{\circ}$ is repeated), so $\operatorname{deg} Q \geq 8$ (unless $Q$ is constant).  Now, we claim $Q(x) \equiv f(U(x))$ for some $f \in \mathbb{R}[x]$. Indeed, if $Q$ is good, then by minimality the quotient $Q \bmod U$ must be constant, so $Q(x)=\widetilde{Q}(x) \cdot U(x)+c$ for some constant $c$, but then $\widetilde{Q}(x)$ is good too and we finish iteratively.


problem: Let $P(x)$ and $Q(x)$ be arbitrary polynomials with real coefficients, with $P \neq 0$, and let $d=\operatorname{deg} P$. Prove that there exist polynomials $A(x)$ and $B(x)$, not both zero, such that $\max \{\operatorname{deg} A, \operatorname{deg} B\} \leq d / 2$ and $P(x) \mid A(x)+Q(x) \cdot B(x)$.

solution: Let $V$ be the vector space of real polynomials with degree at most $d / 2$. Consider maps of linear spaces  $$ \begin{aligned} V^{\oplus 2} & \rightarrow \mathbb{R}[x] /(P(x)) \\ \text { by } \quad(A, B) & \mapsto A+Q B \quad(\bmod P) . \end{aligned} $$  The domain has dimension  $$ 2(\lfloor d / 2\rfloor+1) $$  while the codomain has dimension $d$. For dimension reasons it has nontrivial kernel.


problem: Find the maximum number $E$ such that the following holds: there is an edge-colored graph with 60 vertices and $E$ edges, with each edge colored either red or blue, such that in that coloring, there is no monochromatic cycles of length 3 and no monochromatic cycles of length 5 .

solution: The answer is $E=30^{2}+2 \cdot 15^{2}=6 \cdot 15^{2}=1350$. First, we prove $E \leq 1350$. Observe that: Claim - $G$ contains no $K_{5}$.  Hence by Turán theorem we have $E \leq\binom{ 4}{2} \cdot 15^{2}=1350$. To show this is achievable, take a red $K_{30,30}$, and on each side draw a blue $K_{15,15}$. This graph has no monochromatic odd cycles at all as desired.


problem: Suppose we have distinct positive integers $a, b, c, d$ and an odd prime $p$ not dividing any of them, and an integer $M$ such that if one considers the infinite sequence  $$ \begin{gathered} c a-d b \\ c a^{2}-d b^{2} \\ c a^{3}-d b^{3} \\ c a^{4}-d b^{4} \end{gathered} $$  and looks at the highest power of $p$ that divides each of them, these powers are not all zero, and are all at most $M$. Prove that there exists some $T$ (which may depend on $a, b, c, d, p, M)$ such that whenever $p$ divides an element of this sequence, the maximum power of $p$ that divides that element is exactly $p^{T}$.

solution: By orders, the indices of terms divisible by $p$ is an arithmetic subsequence of $\mathbb{N}$ : say they are $\kappa, \kappa+\lambda, \kappa+2 \lambda, \ldots$, where $\lambda$ is the order of $a / b$. That means we want  $$ \nu_{p}\left(c a^{\kappa+n \lambda}-d b^{\kappa+n \lambda}\right)=\nu_{p}\left(\left(\frac{a^{\lambda}}{b^{\lambda}}\right)^{n}-\frac{d a^{\kappa}}{c b^{\kappa}}\right) $$  to be constant. Thus, we have reduced the problem to the following proposition:  ## Proposition  Let $p$ be an odd prime. Let $x, y \in \mathbb{Q}_{>0}$ such that $x \equiv y \equiv 1(\bmod p)$. If the sequence $\nu_{p}\left(x^{n}-y\right)$ of positive integers is nonconstant, then it is unbounded.  For this it would be sufficient to prove the following claim. Claim - Let $p$ be an odd prime. Let $x, y \in \mathbb{Q}>0$ such that $x \equiv y \equiv 1(\bmod p)$. Suppose $m$ and $n$ are positive integers such that  $$ d=\nu_{p}\left(x^{n}-y\right)<\nu_{p}\left(x^{m}-y\right)=e . $$  Then there exists $\ell$ such that $\nu_{p}\left(x^{\ell}-y\right) \geq e+1$.  $$ \nu_{p}\left(x^{k}-1\right)=e $$  namely $k=p^{e-d}|m-n|$. (In fact, one could also choose more carefully $k=p^{e-d} \cdot \operatorname{gcd}(m-$ $\left.n, p^{\infty}\right)$, so that $k$ is a power of $p$.)  Suppose we set $x^{k}=p^{e} u+1$ and $x^{m}=p^{e} v+y$ where $u, v \in \mathbb{Q}$ aren't divisible by $p$. Now for any integer $1 \leq r \leq p-1$ we consider  $$ \begin{aligned} x^{k r+m}-y & =\left(p^{e} u+1\right)^{r} \cdot\left(p^{e} v+y\right)-y \\ & =p^{e}(v+y u \cdot r)+p^{2 e}(\ldots) \end{aligned} $$  By selecting $r$ with $r \equiv-v / u(\bmod p)$, we ensure $p^{e+1} \mid x^{k r+m}-y$, hence $\ell=k r+m$ is as desired.   $$ x^{\ell-m} \equiv 1 \quad\left(\bmod p^{e}\right) \text { but } x^{\ell-m} \not \equiv 1 \quad\left(\bmod p^{e+1}\right) $$  In particular, we need $\nu_{p}\left(x^{\ell-m}-1\right)=e$ exactly. So the $k$ in the claim must exist if we are going to succeed.  On the other hand, if $k$ is some integer for which $\nu_{p}\left(x^{k}-1\right)=e$, then by choosing $\ell-m$ to be some multiple of $k$ with no extra factors of $p$, we hope that we can get $\nu_{p}\left(x^{\ell}-y\right)=e+1$. That's why we write $\ell=k r+m$ and see what happens when we expand.