di-zhang-fdu/OlympiadExtended huggingface dataset:
Subfield: Algebra


Question: For any set $A=\left\{a_{1}, a_{2}, a_{3}, a_{4}\right\}$ of four distinct positive integers with sum $s_{A}=a_{1}+a_{2}+a_{3}+a_{4}$, let $p_{A}$ denote the number of pairs $(i, j)$ with $1 \leq i<j \leq 4$ for which $a_{i}+a_{j}$ divides $s_{A}$. Among all sets of four distinct positive integers, determine those sets $A$ for which $p_{A}$ is maximal.

Solution:
Firstly, we will prove that the maximum value of $p_{A}$ is at most 4 . Without loss of generality, we may assume that $a_{1}<a_{2}<a_{3}<a_{4}$. We observe that for each pair of indices $(i, j)$ with $1 \leq i<j \leq 4$, the sum $a_{i}+a_{j}$ divides $s_{A}$ if and only if $a_{i}+a_{j}$ divides $s_{A}-\left(a_{i}+a_{j}\right)=a_{k}+a_{l}$, where $k$ and $l$ are the other two indices. Since there are 6 distinct pairs, we have to prove that at least two of them do not satisfy the previous condition. We claim that two such pairs are $\left(a_{2}, a_{4}\right)$ and $\left(a_{3}, a_{4}\right)$. Indeed, note that $a_{2}+a_{4}>a_{1}+a_{3}$ and $a_{3}+a_{4}>a_{1}+a_{2}$. Hence $a_{2}+a_{4}$ and $a_{3}+a_{4}$ do not divide $s_{A}$. This proves $p_{A} \leq 4$.

Now suppose $p_{A}=4$. By the previous argument we have

$$
\begin{array}{lll}
a_{1}+a_{4} \mid a_{2}+a_{3} & \text { and } & a_{2}+a_{3} \mid a_{1}+a_{4}, \\
a_{1}+a_{2} \mid a_{3}+a_{4} & \text { and } & a_{3}+a_{4} \nmid a_{1}+a_{2}, \\
a_{1}+a_{3} \mid a_{2}+a_{4} & \text { and } & a_{2}+a_{4} \nmid a_{1}+a_{3} .
\end{array}
$$

Hence, there exist positive integers $m$ and $n$ with $m>n \geq 2$ such that

$$
\left\{\begin{array}{l}
a_{1}+a_{4}=a_{2}+a_{3} \\
m\left(a_{1}+a_{2}\right)=a_{3}+a_{4} \\
n\left(a_{1}+a_{3}\right)=a_{2}+a_{4}
\end{array}\right.
$$

Adding up the first equation and the third one, we get $n\left(a_{1}+a_{3}\right)=2 a_{2}+a_{3}-a_{1}$. If $n \geq 3$, then $n\left(a_{1}+a_{3}\right)>3 a_{3}>2 a_{2}+a_{3}>2 a_{2}+a_{3}-a_{1}$. This is a contradiction. Therefore $n=2$. If we multiply by 2 the sum of the first equation and the third one, we obtain

$$
6 a_{1}+2 a_{3}=4 a_{2},
$$

while the sum of the first one and the second one is

$$
(m+1) a_{1}+(m-1) a_{2}=2 a_{3}
$$

Adding up the last two equations we get

$$
(m+7) a_{1}=(5-m) a_{2}
$$



It follows that $5-m \geq 1$, because the left-hand side of the last equation and $a_{2}$ are positive. Since we have $m>n=2$, the integer $m$ can be equal only to either 3 or 4 . Substituting $(3,2)$ and $(4,2)$ for $(m, n)$ and solving the previous system of equations, we find the families of solutions $\{d, 5 d, 7 d, 11 d\}$ and $\{d, 11 d, 19 d, 29 d\}$, where $d$ is any positive integer.

Final answer: $\{d, 5 d, 7 d, 11 d\}$ and $\{d, 11 d, 19 d, 29 d\}$, where $d$ is any positive integer. For all these sets $p_{A}$ is 4
Subfield: Algebra


Question: Determine all sequences $\left(x_{1}, x_{2}, \ldots, x_{2011}\right)$ of positive integers such that for every positive integer $n$ there is an integer $a$ with

$$
x_{1}^{n}+2 x_{2}^{n}+\cdots+2011 x_{2011}^{n}=a^{n+1}+1 \text {. }
$$

Solution:
Throughout this solution, the set of positive integers will be denoted by $\mathbb{Z}_{+}$.

Put $k=2+3+\cdots+2011=2023065$. We have

$$
1^{n}+2 k^{n}+\cdots 2011 k^{n}=1+k \cdot k^{n}=k^{n+1}+1
$$

for all $n$, so $(1, k, \ldots, k)$ is a valid sequence. We shall prove that it is the only one.

Let a valid sequence $\left(x_{1}, \ldots, x_{2011}\right)$ be given. For each $n \in \mathbb{Z}_{+}$we have some $y_{n} \in \mathbb{Z}_{+}$with

$$
x_{1}^{n}+2 x_{2}^{n}+\cdots+2011 x_{2011}^{n}=y_{n}^{n+1}+1 \text {. }
$$

Note that $x_{1}^{n}+2 x_{2}^{n}+\cdots+2011 x_{2011}^{n}<\left(x_{1}+2 x_{2}+\cdots+2011 x_{2011}\right)^{n+1}$, which implies that the sequence $\left(y_{n}\right)$ is bounded. In particular, there is some $y \in \mathbb{Z}_{+}$with $y_{n}=y$ for infinitely many $n$.

Let $m$ be the maximum of all the $x_{i}$. Grouping terms with equal $x_{i}$ together, the $\operatorname{sum} x_{1}^{n}+$ $2 x_{2}^{n}+\cdots+2011 x_{2011}^{n}$ can be written as

$$
x_{1}^{n}+2 x_{2}^{n}+\cdots+x_{2011}^{n}=a_{m} m^{n}+a_{m-1}(m-1)^{n}+\cdots+a_{1}
$$

with $a_{i} \geq 0$ for all $i$ and $a_{1}+\cdots+a_{m}=1+2+\cdots+2011$. So there exist arbitrarily large values of $n$, for which

$$
a_{m} m^{n}+\cdots+a_{1}-1-y \cdot y^{n}=0 .
\tag{1}
$$

The following lemma will help us to determine the $a_{i}$ and $y$ :

Lemma. Let integers $b_{1}, \ldots, b_{N}$ be given and assume that there are arbitrarily large positive integers $n$ with $b_{1}+b_{2} 2^{n}+\cdots+b_{N} N^{n}=0$. Then $b_{i}=0$ for all $i$.

Proof. Suppose that not all $b_{i}$ are zero. We may assume without loss of generality that $b_{N} \neq 0$.



Dividing through by $N^{n}$ gives

$$
\left|b_{N}\right|=\left|b_{N-1}\left(\frac{N-1}{N}\right)^{n}+\cdots+b_{1}\left(\frac{1}{N}\right)^{n}\right| \leq\left(\left|b_{N-1}\right|+\cdots+\left|b_{1}\right|\right)\left(\frac{N-1}{N}\right)^{n} .
$$

The expression $\left(\frac{N-1}{N}\right)^{n}$ can be made arbitrarily small for $n$ large enough, contradicting the assumption that $b_{N}$ be non-zero.

We obviously have $y>1$. Applying the lemma to (1) we see that $a_{m}=y=m, a_{1}=1$, and all the other $a_{i}$ are zero. This implies $\left(x_{1}, \ldots, x_{2011}\right)=(1, m, \ldots, m)$. But we also have $1+m=a_{1}+\cdots+a_{m}=1+\cdots+2011=1+k$ so $m=k$, which is what we wanted to show.

Final answer: $$
\left(x_{1}, \ldots, x_{2011}\right)=(1, k, \ldots, k) \quad \text { with } k=2+3+\cdots+2011=2023065
$$
Subfield: Algebra


Question: Determine all pairs $(f, g)$ of functions from the set of real numbers to itself that satisfy

$$
g(f(x+y))=f(x)+(2 x+y) g(y)
$$

for all real numbers $x$ and $y$.

Solution:
Clearly all these pairs of functions satisfy the functional equation in question, so it suffices to verify that there cannot be any further ones. Substituting $-2 x$ for $y$ in the given functional equation we obtain

$$
g(f(-x))=f(x)
\tag{1}
$$

Using this equation for $-x-y$ in place of $x$ we obtain

$$
f(-x-y)=g(f(x+y))=f(x)+(2 x+y) g(y) .
\tag{2}
$$

Now for any two real numbers $a$ and $b$, setting $x=-b$ and $y=a+b$ we get

$$
f(-a)=f(-b)+(a-b) g(a+b) .
$$

If $c$ denotes another arbitrary real number we have similarly

$$
f(-b)=f(-c)+(b-c) g(b+c)
$$

as well as

$$
f(-c)=f(-a)+(c-a) g(c+a) .
$$

Adding all these equations up, we obtain

$$
((a+c)-(b+c)) g(a+b)+((a+b)-(a+c)) g(b+c)+((b+c)-(a+b)) g(a+c)=0 \text {. }
$$

Now given any three real numbers $x, y$, and $z$ one may determine three reals $a, b$, and $c$ such that $x=b+c, y=c+a$, and $z=a+b$, so that we get

$$
(y-x) g(z)+(z-y) g(x)+(x-z) g(y)=0 .
$$

This implies that the three points $(x, g(x)),(y, g(y))$, and $(z, g(z))$ from the graph of $g$ are collinear. Hence that graph is a line, i.e., $g$ is either a constant or a linear function.



Let us write $g(x)=A x+B$, where $A$ and $B$ are two real numbers. Substituting $(0,-y)$ for $(x, y)$ in (2) and denoting $C=f(0)$, we have $f(y)=A y^{2}-B y+C$. Now, comparing the coefficients of $x^{2}$ in (1) we see that $A^{2}=A$, so $A=0$ or $A=1$.

If $A=0$, then (11) becomes $B=-B x+C$ and thus $B=C=0$, which provides the first of the two solutions mentioned above.

Now suppose $A=1$. Then (11) becomes $x^{2}-B x+C+B=x^{2}-B x+C$, so $B=0$. Thus, $g(x)=x$ and $f(x)=x^{2}+C$, which is the second solution from above.

Final answer: Either both $f$ and $g$ vanish identically, or there exists a real number $C$ such that $f(x)=x^{2}+C$ and $g(x)=x$ for all real numbers $x$
Subfield: Algebra


Question: Determine all pairs $(f, g)$ of functions from the set of positive integers to itself that satisfy

$$
f^{g(n)+1}(n)+g^{f(n)}(n)=f(n+1)-g(n+1)+1
$$

for every positive integer $n$. Here, $f^{k}(n)$ means $\underbrace{f(f(\ldots f}_{k}(n) \ldots))$.

Solution:
The given relation implies

$$
f\left(f^{g(n)}(n)\right)<f(n+1) \quad \text { for all } n
\tag{1}
$$

which will turn out to be sufficient to determine $f$.

Let $y_{1}<y_{2}<\ldots$ be all the values attained by $f$ (this sequence might be either finite or infinite). We will prove that for every positive $n$ the function $f$ attains at least $n$ values, and we have (i) $)_{n}: f(x)=y_{n}$ if and only if $x=n$, and $(\mathrm{ii})_{n}: y_{n}=n$. The proof will follow the scheme

$$
(\mathrm{i})_{1},(\mathrm{ii})_{1},(\mathrm{i})_{2},(\mathrm{ii})_{2}, \ldots,(\mathrm{i})_{n},(\mathrm{ii})_{n}, \ldots
\tag{2}
$$

To start, consider any $x$ such that $f(x)=y_{1}$. If $x>1$, then (1) reads $f\left(f^{g(x-1)}(x-1)\right)<y_{1}$, contradicting the minimality of $y_{1}$. So we have that $f(x)=y_{1}$ is equivalent to $x=1$, establishing $(\mathrm{i})_{1}$.

Next, assume that for some $n$ statement $(\mathrm{i})_{n}$ is established, as well as all the previous statements in (2). Note that these statements imply that for all $k \geq 1$ and $a<n$ we have $f^{k}(x)=a$ if and only if $x=a$.

Now, each value $y_{i}$ with $1 \leq i \leq n$ is attained at the unique integer $i$, so $y_{n+1}$ exists. Choose an arbitrary $x$ such that $f(x)=y_{n+1}$; we necessarily have $x>n$. Substituting $x-1$ into (1) we have $f\left(f^{g(x-1)}(x-1)\right)<y_{n+1}$, which implies

$$
f^{g(x-1)}(x-1) \in\{1, \ldots, n\}
\tag{3}
$$

Set $b=f^{g(x-1)}(x-1)$. If $b<n$ then we would have $x-1=b$ which contradicts $x>n$. So $b=n$, and hence $y_{n}=n$, which proves (ii) ${ }_{n}$. Next, from (i) ${ }_{n}$ we now get $f(k)=n \Longleftrightarrow k=n$, so removing all the iterations of $f$ in (3) we obtain $x-1=b=n$, which proves $(\mathrm{i})_{n+1}$.

So, all the statements in (2) are valid and hence $f(n)=n$ for all $n$. The given relation between $f$ and $g$ now reads $n+g^{n}(n)=n+1-g(n+1)+1$ or $g^{n}(n)+g(n+1)=2$, from which it immediately follows that we have $g(n)=1$ for all $n$.



Final answer: $f(n)=n$, $g(n)=1$
Subfield: Algebra


Question: Prove that for every positive integer $n$, the set $\{2,3,4, \ldots, 3 n+1\}$ can be partitioned into $n$ triples in such a way that the numbers from each triple are the lengths of the sides of some obtuse triangle.

Solution:
Throughout the solution, we denote by $[a, b]$ the set $\{a, a+1, \ldots, b\}$. We say that $\{a, b, c\}$ is an obtuse triple if $a, b, c$ are the sides of some obtuse triangle.

We prove by induction on $n$ that there exists a partition of $[2,3 n+1]$ into $n$ obtuse triples $A_{i}$ $(2 \leq i \leq n+1)$ having the form $A_{i}=\left\{i, a_{i}, b_{i}\right\}$. For the base case $n=1$, one can simply set $A_{2}=\{2,3,4\}$. For the induction step, we need the following simple lemma.

Lemma. Suppose that the numbers $a<b<c$ form an obtuse triple, and let $x$ be any positive number. Then the triple $\{a, b+x, c+x\}$ is also obtuse.

Proof. The numbers $a<b+x<c+x$ are the sides of a triangle because $(c+x)-(b+x)=$ $c-b<a$. This triangle is obtuse since $(c+x)^{2}-(b+x)^{2}=(c-b)(c+b+2 x)>(c-b)(c+b)>a^{2}$.

Now we turn to the induction step. Let $n>1$ and put $t=\lfloor n / 2\rfloor<n$. By the induction hypothesis, there exists a partition of the set $[2,3 t+1]$ into $t$ obtuse triples $A_{i}^{\prime}=\left\{i, a_{i}^{\prime}, b_{i}^{\prime}\right\}$ $(i \in[2, t+1])$. For the same values of $i$, define $A_{i}=\left\{i, a_{i}^{\prime}+(n-t), b_{i}^{\prime}+(n-t)\right\}$. The constructed triples are obviously disjoint, and they are obtuse by the lemma. Moreover, we have

$$
\bigcup_{i=2}^{t+1} A_{i}=[2, t+1] \cup[n+2, n+2 t+1]
$$

Next, for each $i \in[t+2, n+1]$, define $A_{i}=\{i, n+t+i, 2 n+i\}$. All these sets are disjoint, and

$$
\bigcup_{i=t+2}^{n+1} A_{i}=[t+2, n+1] \cup[n+2 t+2,2 n+t+1] \cup[2 n+t+2,3 n+1]
$$

so

$$
\bigcup_{i=2}^{n+1} A_{i}=[2,3 n+1]
$$

Thus, we are left to prove that the triple $A_{i}$ is obtuse for each $i \in[t+2, n+1]$.

Since $(2 n+i)-(n+t+i)=n-t<t+2 \leq i$, the elements of $A_{i}$ are the sides of a triangle. Next, we have

$(2 n+i)^{2}-(n+t+i)^{2}=(n-t)(3 n+t+2 i) \geq \frac{n}{2} \cdot(3 n+3(t+1)+1)>\frac{n}{2} \cdot \frac{9 n}{2} \geq(n+1)^{2} \geq i^{2}$,

so this triangle is obtuse. The proof is completed.
Subfield: Algebra


Question: Let $f$ be a function from the set of real numbers to itself that satisfies

$$
f(x+y) \leq y f(x)+f(f(x))
\tag{1}
$$

for all real numbers $x$ and $y$. Prove that $f(x)=0$ for all $x \leq 0$.

Solution:
Substituting $y=t-x$, we rewrite (11) as

$$
f(t) \leq t f(x)-x f(x)+f(f(x)) .
\tag{2}
$$

Consider now some real numbers $a, b$ and use (2) with $t=f(a), x=b$ as well as with $t=f(b)$, $x=a$. We get

$$
\begin{aligned}
& f(f(a))-f(f(b)) \leq f(a) f(b)-b f(b) \\
& f(f(b))-f(f(a)) \leq f(a) f(b)-a f(a)
\end{aligned}
$$

Adding these two inequalities yields

$$
2 f(a) f(b) \geq a f(a)+b f(b)
$$

Now, substitute $b=2 f(a)$ to obtain $2 f(a) f(b) \geq a f(a)+2 f(a) f(b)$, or $a f(a) \leq 0$. So, we get

$$
f(a) \geq 0 \text { for all } a<0
\tag{3}
$$

Now suppose $f(x)>0$ for some real number $x$. From (2) we immediately get that for every $t<\frac{x f(x)-f(f(x))}{f(x)}$ we have $f(t)<0$. This contradicts (3); therefore

$$
f(x) \leq 0 \text { for all real } x
\tag{4}
$$

and by (3) again we get $f(x)=0$ for all $x<0$.

We are left to find $f(0)$. Setting $t=x<0$ in (2) we get

$$
0 \leq 0-0+f(0)
$$

so $f(0) \geq 0$. Combining this with (4) we obtain $f(0)=0$.
We will also use the condition of the problem in form (2). For clarity we divide the argument into four steps.



Step 1. We begin by proving that $f$ attains nonpositive values only. Assume that there exist some real number $z$ with $f(z)>0$. Substituting $x=z$ into (2) and setting $A=f(z)$, $B=-z f(z)-f(f(z))$ we get $f(t) \leq A t+B$ for all real $t$. Hence, if for any positive real number $t$ we substitute $x=-t, y=t$ into (1), we get

$$
\begin{aligned}
f(0) & \leq t f(-t)+f(f(-t)) \leq t(-A t+B)+A f(-t)+B \\
& \leq-t(A t-B)+A(-A t+B)+B=-A t^{2}-\left(A^{2}-B\right) t+(A+1) B .
\end{aligned}
$$

But surely this cannot be true if we take $t$ to be large enough. This contradiction proves that we have indeed $f(x) \leq 0$ for all real numbers $x$. Note that for this reason (1) entails

$$
f(x+y) \leq y f(x)
\tag{5}
$$

for all real numbers $x$ and $y$.

Step 2. We proceed by proving that $f$ has at least one zero. If $f(0)=0$, we are done. Otherwise, in view of Step 1 we get $f(0)<0$. Observe that (5) tells us now $f(y) \leq y f(0)$ for all real numbers $y$. Thus we can specify a positive real number $a$ that is so large that $f(a)^{2}>-f(0)$. Put $b=f(a)$ and substitute $x=b$ and $y=-b$ into (5); we learn $-b^{2}<f(0) \leq-b f(b)$, i.e. $b<f(b)$. Now we apply (2) to $x=b$ and $t=f(b)$, which yields

$$
f(f(b)) \leq(f(b)-b) f(b)+f(f(b))
$$

i.e. $f(b) \geq 0$. So in view of Step $1, b$ is a zero of $f$.

Step 3. Next we show that if $f(a)=0$ and $b<a$, then $f(b)=0$ as well. To see this, we just substitute $x=b$ and $y=a-b$ into (5), thus getting $f(b) \geq 0$, which suffices by Step 1 .

Step 4. By Step 3, the solution of the problem is reduced to showing $f(0)=0$. Pick any zero $r$ of $f$ and substitute $x=r$ and $y=-1$ into (1). Because of $f(r)=f(r-1)=0$ this gives $f(0) \geq 0$ and hence $f(0)=0$ by Step 1 again.
Subfield: Combinatorics


Question: Suppose that 1000 students are standing in a circle. Prove that there exists an integer $k$ with $100 \leq k \leq 300$ such that in this circle there exists a contiguous group of $2 k$ students, for which the first half contains the same number of girls as the second half.

Solution:
Number the students consecutively from 1 to 1000. Let $a_{i}=1$ if the $i$ th student is a girl, and $a_{i}=0$ otherwise. We expand this notion for all integers $i$ by setting $a_{i+1000}=$ $a_{i-1000}=a_{i}$. Next, let

$$
S_{k}(i)=a_{i}+a_{i+1}+\cdots+a_{i+k-1}
$$

Now the statement of the problem can be reformulated as follows:

There exist an integer $k$ with $100 \leq k \leq 300$ and an index $i$ such that $S_{k}(i)=S_{k}(i+k)$.

Assume now that this statement is false. Choose an index $i$ such that $S_{100}(i)$ attains the maximal possible value. In particular, we have $S_{100}(i-100)-S_{100}(i)<0$ and $S_{100}(i)-S_{100}(i+100)>0$, for if we had an equality, then the statement would hold. This means that the function $S(j)-$ $S(j+100)$ changes sign somewhere on the segment $[i-100, i]$, so there exists some index $j \in$ $[i-100, i-1]$ such that

$$
S_{100}(j) \leq S_{100}(j+100)-1, \quad \text { but } \quad S_{100}(j+1) \geq S_{100}(j+101)+1
\tag{1}
$$

Subtracting the first inequality from the second one, we get $a_{j+100}-a_{j} \geq a_{j+200}-a_{j+100}+2$, so

$$
a_{j}=0, \quad a_{j+100}=1, \quad a_{j+200}=0
$$

Substituting this into the inequalities of (1), we also obtain $S_{99}(j+1) \leq S_{99}(j+101) \leq S_{99}(j+1)$, which implies

$$
S_{99}(j+1)=S_{99}(j+101) .
\tag{2}
$$

Now let $k$ and $\ell$ be the least positive integers such that $a_{j-k}=1$ and $a_{j+200+\ell}=1$. By symmetry, we may assume that $k \geq \ell$. If $k \geq 200$ then we have $a_{j}=a_{j-1}=\cdots=a_{j-199}=0$, so $S_{100}(j-199)=S_{100}(j-99)=0$, which contradicts the initial assumption. Hence $\ell \leq k \leq 199$. Finally, we have

$$
\begin{gathered}
S_{100+\ell}(j-\ell+1)=\left(a_{j-\ell+1}+\cdots+a_{j}\right)+S_{99}(j+1)+a_{j+100}=S_{99}(j+1)+1 \\
S_{100+\ell}(j+101)=S_{99}(j+101)+\left(a_{j+200}+\cdots+a_{j+200+\ell-1}\right)+a_{j+200+\ell}=S_{99}(j+101)+1
\end{gathered}
$$

Comparing with (2) we get $S_{100+\ell}(j-\ell+1)=S_{100+\ell}(j+101)$ and $100+\ell \leq 299$, which again contradicts our assumption.
Subfield: Combinatorics


Question: Let $n$ be a positive integer and let $W=\ldots x_{-1} x_{0} x_{1} x_{2} \ldots$ be an infinite periodic word consisting of the letters $a$ and $b$. Suppose that the minimal period $N$ of $W$ is greater than $2^{n}$.

A finite nonempty word $U$ is said to appear in $W$ if there exist indices $k \leq \ell$ such that $U=x_{k} x_{k+1} \ldots x_{\ell}$. A finite word $U$ is called ubiquitous if the four words $U a, U b, a U$, and $b U$ all appear in $W$. Prove that there are at least $n$ ubiquitous finite nonempty words.

Solution:
Throughout the solution, all the words are nonempty. For any word $R$ of length $m$, we call the number of indices $i \in\{1,2, \ldots, N\}$ for which $R$ coincides with the subword $x_{i+1} x_{i+2} \ldots x_{i+m}$ of $W$ the multiplicity of $R$ and denote it by $\mu(R)$. Thus a word $R$ appears in $W$ if and only if $\mu(R)>0$. Since each occurrence of a word in $W$ is both succeeded by either the letter $a$ or the letter $b$ and similarly preceded by one of those two letters, we have

$$
\mu(R)=\mu(R a)+\mu(R b)=\mu(a R)+\mu(b R)
\tag{1}
$$

for all words $R$.

We claim that the condition that $N$ is in fact the minimal period of $W$ guarantees that each word of length $N$ has multiplicity 1 or 0 depending on whether it appears or not. Indeed, if the words $x_{i+1} x_{i+2} \ldots x_{i+N}$ and $x_{j+1} \ldots x_{j+N}$ are equal for some $1 \leq i<j \leq N$, then we have $x_{i+a}=x_{j+a}$ for every integer $a$, and hence $j-i$ is also a period.

Moreover, since $N>2^{n}$, at least one of the two words $a$ and $b$ has a multiplicity that is strictly larger than $2^{n-1}$.

For each $k=0,1, \ldots, n-1$, let $U_{k}$ be a subword of $W$ whose multiplicity is strictly larger than $2^{k}$ and whose length is maximal subject to this property. Note that such a word exists in view of the two observations made in the two previous paragraphs.

Fix some index $k \in\{0,1, \ldots, n-1\}$. Since the word $U_{k} b$ is longer than $U_{k}$, its multiplicity can be at most $2^{k}$, so in particular $\mu\left(U_{k} b\right)<\mu\left(U_{k}\right)$. Therefore, the word $U_{k} a$ has to appear by (1). For a similar reason, the words $U_{k} b, a U_{k}$, and $b U_{k}$ have to appear as well. Hence, the word $U_{k}$ is ubiquitous. Moreover, if the multiplicity of $U_{k}$ were strictly greater than $2^{k+1}$, then by (11) at least one of the two words $U_{k} a$ and $U_{k} b$ would have multiplicity greater than $2^{k}$ and would thus violate the maximality condition imposed on $U_{k}$.

So we have $\mu\left(U_{0}\right) \leq 2<\mu\left(U_{1}\right) \leq 4<\ldots \leq 2^{n-1}<\mu\left(U_{n-1}\right)$, which implies in particular that the words $U_{0}, U_{1}, \ldots, U_{n-1}$ have to be distinct. As they have been proved to be ubiquitous as well, the problem is solved.
Subfield: Geometry


Question: Let $A B C$ be an acute triangle. Let $\omega$ be a circle whose center $L$ lies on the side $B C$. Suppose that $\omega$ is tangent to $A B$ at $B^{\prime}$ and to $A C$ at $C^{\prime}$. Suppose also that the circumcenter $O$ of the triangle $A B C$ lies on the shorter arc $B^{\prime} C^{\prime}$ of $\omega$. Prove that the circumcircle of $A B C$ and $\omega$ meet at two points.

Solution:
The point $B^{\prime}$, being the perpendicular foot of $L$, is an interior point of side $A B$. Analogously, $C^{\prime}$ lies in the interior of $A C$. The point $O$ is located inside the triangle $A B^{\prime} C^{\prime}$, hence $\angle C O B<\angle C^{\prime} O B^{\prime}$.

<img_3645>

Let $\alpha=\angle C A B$. The angles $\angle C A B$ and $\angle C^{\prime} O B^{\prime}$ are inscribed into the two circles with centers $O$ and $L$, respectively, so $\angle C O B=2 \angle C A B=2 \alpha$ and $2 \angle C^{\prime} O B^{\prime}=360^{\circ}-\angle C^{\prime} L B^{\prime}$. From the kite $A B^{\prime} L C^{\prime}$ we have $\angle C^{\prime} L B^{\prime}=180^{\circ}-\angle C^{\prime} A B^{\prime}=180^{\circ}-\alpha$. Combining these, we get

$$
2 \alpha=\angle C O B<\angle C^{\prime} O B^{\prime}=\frac{360^{\circ}-\angle C^{\prime} L B^{\prime}}{2}=\frac{360^{\circ}-\left(180^{\circ}-\alpha\right)}{2}=90^{\circ}+\frac{\alpha}{2}
$$

so

$$
\alpha<60^{\circ}
$$

Let $O^{\prime}$ be the reflection of $O$ in the line $B C$. In the quadrilateral $A B O^{\prime} C$ we have

$$
\angle C O^{\prime} B+\angle C A B=\angle C O B+\angle C A B=2 \alpha+\alpha<180^{\circ},
$$

so the point $O^{\prime}$ is outside the circle $A B C$. Hence, $O$ and $O^{\prime}$ are two points of $\omega$ such that one of them lies inside the circumcircle, while the other one is located outside. Therefore, the two circles intersect.