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


Question: Let $A B C$ be a triangle with circumcenter $O$. The points $P$ and $Q$ are interior points of the sides $C A$ and $A B$, respectively. The circle $k$ passes through the midpoints of the segments $B P$, $C Q$, and $P Q$. Prove that if the line $P Q$ is tangent to circle $k$ then $O P=O Q$.

Solution:
Let $K, L, M, B^{\prime}, C^{\prime}$ be the midpoints of $B P, C Q, P Q, C A$, and $A B$, respectively (see Figure 1). Since $C A \| L M$, we have $\angle L M P=\angle Q P A$. Since $k$ touches the segment $P Q$ at $M$, we find $\angle L M P=\angle L K M$. Thus $\angle Q P A=\angle L K M$. Similarly it follows from $A B \| M K$ that $\angle P Q A=\angle K L M$. Therefore, triangles $A P Q$ and $M K L$ are similar, hence

$$
\frac{A P}{A Q}=\frac{M K}{M L}=\frac{\frac{Q B}{2}}{\frac{P C}{2}}=\frac{Q B}{P C}
\tag{1}
$$

Now (1) is equivalent to $A P \cdot P C=A Q \cdot Q B$ which means that the power of points $P$ and $Q$ with respect to the circumcircle of $\triangle A B C$ are equal, hence $O P=O Q$.

<img_3561>

Figure 1
Again, denote by $K, L, M$ the midpoints of segments $B P, C Q$, and $P Q$, respectively. Let $O, S, T$ be the circumcenters of triangles $A B C, K L M$, and $A P Q$, respectively (see Figure 2). Note that $M K$ and $L M$ are the midlines in triangles $B P Q$ and $C P Q$, respectively, so $\overrightarrow{M K}=\frac{1}{2} \overrightarrow{Q B}$ and $\overrightarrow{M L}=\frac{1}{2} \overrightarrow{P C}$. Denote by $\operatorname{pr}_{l}(\vec{v})$ the projection of vector $\vec{v}$ onto line $l$. Then $\operatorname{pr}_{A B}(\overrightarrow{O T})=\operatorname{pr}_{A B}(\overrightarrow{O A}-\overrightarrow{T A})=\frac{1}{2} \overrightarrow{B A}-\frac{1}{2} \overrightarrow{Q A}=\frac{1}{2} \overrightarrow{B Q}=\overrightarrow{K M}$ and $\operatorname{pr}_{A B}(\overrightarrow{S M})=\operatorname{pr}_{M K}(\overrightarrow{S M})=$ $\frac{1}{2} \overrightarrow{K M}=\frac{1}{2} \operatorname{pr}_{A B}(\overrightarrow{O T})$. Analogously we get $\operatorname{pr}_{C A}(\overrightarrow{S M})=\frac{1}{2} \operatorname{pr}_{C A}(\overrightarrow{O T})$. Since $A B$ and $C A$ are not parallel, this implies that $\overrightarrow{S M}=\frac{1}{2} \overrightarrow{O T}$.

<img_3216>

Figure 2

Now, since the circle $k$ touches $P Q$ at $M$, we get $S M \perp P Q$, hence $O T \perp P Q$. Since $T$ is equidistant from $P$ and $Q$, the line $O T$ is a perpendicular bisector of segment $P Q$, and hence $O$ is equidistant from $P$ and $Q$ which finishes the proof.
Subfield: Number Theory


Question: A positive integer $N$ is called balanced, if $N=1$ or if $N$ can be written as a product of an even number of not necessarily distinct primes. Given positive integers $a$ and $b$, consider the polynomial $P$ defined by $P(x)=(x+a)(x+b)$.
Prove that there exist distinct positive integers $a$ and $b$ such that all the numbers $P(1), P(2)$, $\ldots, P(50)$ are balanced.

Solution:
Define a function $f$ on the set of positive integers by $f(n)=0$ if $n$ is balanced and $f(n)=1$ otherwise. Clearly, $f(n m) \equiv f(n)+f(m) \bmod 2$ for all positive integers $n, m$.

Now for each positive integer $n$ consider the binary sequence $(f(n+1), f(n+2), \ldots, f(n+$ $50)$ ). As there are only $2^{50}$ different such sequences there are two different positive integers $a$ and $b$ such that

$$
(f(a+1), f(a+2), \ldots, f(a+50))=(f(b+1), f(b+2), \ldots, f(b+50)) \text {. }
$$

But this implies that for the polynomial $P(x)=(x+a)(x+b)$ all the numbers $P(1), P(2)$, $\ldots, P(50)$ are balanced, since for all $1 \leq k \leq 50$ we have $f(P(k)) \equiv f(a+k)+f(b+k) \equiv$ $2 f(a+k) \equiv 0 \bmod 2$.
Subfield: Number Theory


Question: A positive integer $N$ is called balanced, if $N=1$ or if $N$ can be written as a product of an even number of not necessarily distinct primes. Given positive integers $a$ and $b$, consider the polynomial $P$ defined by $P(x)=(x+a)(x+b)$.
Prove that if $P(n)$ is balanced for all positive integers $n$, then $a=b$.

Solution:
Define a function $f$ on the set of positive integers by $f(n)=0$ if $n$ is balanced and $f(n)=1$ otherwise. Clearly, $f(n m) \equiv f(n)+f(m) \bmod 2$ for all positive integers $n, m$.

Now suppose $P(n)$ is balanced for all positive integers $n$ and $a<b$. Set $n=k(b-a)-a$ for sufficiently large $k$, such that $n$ is positive. Then $P(n)=k(k+1)(b-a)^{2}$, and this number can only be balanced, if $f(k)=f(k+1)$ holds. Thus, the sequence $f(k)$ must become constant for sufficiently large $k$. But this is not possible, as for every prime $p$ we have $f(p)=1$ and for every square $t^{2}$ we have $f\left(t^{2}\right)=0$.

Hence $a=b$.
Subfield: Number Theory


Question: Let $f$ be a non-constant function from the set of positive integers into the set of positive integers, such that $a-b$ divides $f(a)-f(b)$ for all distinct positive integers $a, b$. Prove that there exist infinitely many primes $p$ such that $p$ divides $f(c)$ for some positive integer $c$.

Solution:
Denote by $v_{p}(a)$ the exponent of the prime $p$ in the prime decomposition of $a$.

Assume that there are only finitely many primes $p_{1}, p_{2}, \ldots, p_{m}$ that divide some function value produced of $f$.

There are infinitely many positive integers $a$ such that $v_{p_{i}}(a)>v_{p_{i}}(f(1))$ for all $i=1,2, \ldots, m$, e.g. $a=\left(p_{1} p_{2} \ldots p_{m}\right)^{\alpha}$ with $\alpha$ sufficiently large. Pick any such $a$. The condition of the problem then yields $a \mid(f(a+1)-f(1))$. Assume $f(a+1) \neq f(1)$. Then we must have $v_{p_{i}}(f(a+1)) \neq$ $v_{p_{i}}(f(1))$ for at least one $i$. This yields $v_{p_{i}}(f(a+1)-f(1))=\min \left\{v_{p_{i}}(f(a+1)), v_{p_{i}}(f(1))\right\} \leq$ $v_{p_{1}}(f(1))<v_{p_{i}}(a)$. But this contradicts the fact that $a \mid(f(a+1)-f(1))$.

Hence we must have $f(a+1)=f(1)$ for all such $a$.

Now, for any positive integer $b$ and all such $a$, we have $(a+1-b) \mid(f(a+1)-f(b))$, i.e., $(a+1-b) \mid(f(1)-f(b))$. Since this is true for infinitely many positive integers $a$ we must have $f(b)=f(1)$. Hence $f$ is a constant function, a contradiction. Therefore, our initial assumption was false and there are indeed infinitely many primes $p$ dividing $f(c)$ for some positive integer c.
Assume that there are only finitely many primes $p_{1}, p_{2}, \ldots, p_{m}$ that divide some function value of $f$. Since $f$ is not identically 1 , we must have $m \geq 1$.

Then there exist non-negative integers $\alpha_{1}, \ldots, \alpha_{m}$ such that

$$
f(1)=p_{1}^{\alpha_{1}} p_{2}^{\alpha_{2}} \ldots p_{m}^{\alpha_{m}}
$$

We can pick a positive integer $r$ such that $f(r) \neq f(1)$. Let

$$
M=1+p_{1}^{\alpha_{1}+1} p_{2}^{\alpha_{2}+1} \ldots p_{m}^{\alpha_{m}+1} \cdot(f(r)+r)
$$

Then for all $i \in\{1, \ldots, m\}$ we have that $p_{i}^{\alpha_{i}+1}$ divides $M-1$ and hence by the condition of the problem also $f(M)-f(1)$. This implies that $f(M)$ is divisible by $p_{i}^{\alpha_{i}}$ but not by $p_{i}^{\alpha_{i}+1}$ for all $i$ and therefore $f(M)=f(1)$.

Hence

$$
\begin{aligned}
M-r & >p_{1}^{\alpha_{1}+1} p_{2}^{\alpha_{2}+1} \ldots p_{m}^{\alpha_{m}+1} \cdot(f(r)+r)-r \\
& \geq p_{1}^{\alpha_{1}+1} p_{2}^{\alpha_{2}+1} \ldots p_{m}^{\alpha_{m}+1}+(f(r)+r)-r \\
& >p_{1}^{\alpha_{1}} p_{2}^{\alpha_{2}} \ldots p_{m}^{\alpha_{m}}+f(r) \\
& \geq|f(M)-f(r)| .
\end{aligned}
$$

But since $M-r$ divides $f(M)-f(r)$ this can only be true if $f(r)=f(M)=f(1)$, which contradicts the choice of $r$.
Subfield: Number Theory


Question: Let $P(x)$ be a non-constant polynomial with integer coefficients. Prove that there is no function $T$ from the set of integers into the set of integers such that the number of integers $x$ with $T^{n}(x)=x$ is equal to $P(n)$ for every $n \geq 1$, where $T^{n}$ denotes the $n$-fold application of $T$.

Solution:
Assume there is a polynomial $P$ of degree at least 1 with the desired property for a given function $T$. Let $A(n)$ denote the set of all $x \in \mathbb{Z}$ such that $T^{n}(x)=x$ and let $B(n)$ denote the set of all $x \in \mathbb{Z}$ for which $T^{n}(x)=x$ and $T^{k}(x) \neq x$ for all $1 \leq k<n$. Both sets are finite under the assumption made. For each $x \in A(n)$ there is a smallest $k \geq 1$ such that $T^{k}(x)=x$, i.e., $x \in B(k)$. Let $d=\operatorname{gcd}(k, n)$. There are positive integers $r, s$ such that $r k-s n=d$ and hence $x=T^{r k}(x)=T^{s n+d}(x)=T^{d}\left(T^{s n}(x)\right)=T^{d}(x)$. The minimality of $k$ implies $d=k$, i.e., $k \mid n$. On the other hand one clearly has $B(k) \subset A(n)$ if $k \mid n$ and thus we have $A(n)=\bigcup_{d \mid n} B(d)$ as a disjoint union and hence

$$
|A(n)|=\sum_{d \mid n}|B(d)|
$$

Furthermore, for every $x \in B(n)$ the elements $x, T^{1}(x), T^{2}(x), \ldots, T^{n-1}(x)$ are $n$ distinct elements of $B(n)$. The fact that they are in $A(n)$ is obvious. If for some $k<n$ and some $0 \leq i<n$ we had $T^{k}\left(T^{i}(x)\right)=T^{i}(x)$, i.e. $T^{k+i}(x)=T^{i}(x)$, that would imply $x=T^{n}(x)=T^{n-i}\left(T^{i}(x)\right)=T^{n-i}\left(T^{k+i}(x)\right)=T^{k}\left(T^{n}(x)\right)=T^{k}(x)$ contradicting the minimality of $n$. Thus $T^{i}(x) \in B(n)$ and $T^{i}(x) \neq T^{j}(x)$ for $0 \leq i<j \leq n-1$.

So indeed, $T$ permutes the elements of $B(n)$ in (disjoint) cycles of length $n$ and in particular one has $n|| B(n) \mid$.

Now let $P(x)=\sum_{i=0}^{k} a_{i} x^{i}, a_{i} \in \mathbb{Z}, k \geq 1, a_{k} \neq 0$ and suppose that $|A(n)|=P(n)$ for all $n \geq 1$. Let $p$ be any prime. Then

$$
p^{2}|| B\left(p^{2}\right)|=| A\left(p^{2}\right)|-| A(p) \mid=a_{1}\left(p^{2}-p\right)+a_{2}\left(p^{4}-p^{2}\right)+\ldots
$$

Hence $p \mid a_{1}$ and since this is true for all primes we must have $a_{1}=0$.

Now consider any two different primes $p$ and $q$. Since $a_{1}=0$ we have that

$$
\left|A\left(p^{2} q\right)\right|-|A(p q)|=a_{2}\left(p^{4} q^{2}-p^{2} q^{2}\right)+a_{3}\left(p^{6} q^{3}-p^{3} q^{3}\right)+\ldots
$$

is a multiple of $p^{2} q$. But we also have

$$
p^{2} q|| B\left(p^{2} q\right)|=| A\left(p^{2} q\right)|-| A(p q)|-| B\left(p^{2}\right) \mid .
$$

This implies

$$
p^{2} q|| B\left(p^{2}\right)|=| A\left(p^{2}\right)|-| A(p) \mid=a_{2}\left(p^{4}-p^{2}\right)+a_{3}\left(p^{6}-p^{3}\right)+\cdots+a_{k}\left(p^{2 k}-p^{k}\right)
$$

Since this is true for every prime $q$ we must have $a_{2}\left(p^{4}-p^{2}\right)+a_{3}\left(p^{6}-p^{3}\right)+\cdots+a_{k}\left(p^{2 k}-p^{k}\right)=0$ for every prime $p$. Since this expression is a polynomial in $p$ of degree $2 k$ (because $a_{k} \neq 0$ ) this is a contradiction, as such a polynomial can have at most $2 k$ zeros.
Subfield: Algebra


Question: Find all functions $f:(0, \infty) \rightarrow(0, \infty)$ such that

$$
\frac{f(p)^{2}+f(q)^{2}}{f\left(r^{2}\right)+f\left(s^{2}\right)}=\frac{p^{2}+q^{2}}{r^{2}+s^{2}}
$$

for all $p, q, r, s>0$ with $p q=r s$.

Solution:
Let $f$ satisfy the given condition. Setting $p=q=r=s=1$ yields $f(1)^{2}=f(1)$ and hence $f(1)=1$. Now take any $x>0$ and set $p=x, q=1, r=s=\sqrt{x}$ to obtain

$$
\frac{f(x)^{2}+1}{2 f(x)}=\frac{x^{2}+1}{2 x}
$$

This recasts into

$$
\begin{gathered}
x f(x)^{2}+x=x^{2} f(x)+f(x), \\
(x f(x)-1)(f(x)-x)=0 .
\end{gathered}
$$

And thus,

$$
\text { for every } x>0, \text { either } f(x)=x \text { or } f(x)=\frac{1}{x} \text {. }
\tag{1}
$$

Obviously, if

$$
f(x)=x \quad \text { for all } x>0 \quad \text { or } \quad f(x)=\frac{1}{x} \quad \text { for all } x>0\tag{2}
$$

then the condition of the problem is satisfied. We show that actually these two functions are the only solutions.

So let us assume that there exists a function $f$ satisfying the requirement, other than those in (2). Then $f(a) \neq a$ and $f(b) \neq 1 / b$ for some $a, b>0$. By (1), these values must be $f(a)=1 / a, f(b)=b$. Applying now the equation with $p=a, q=b, r=s=\sqrt{a b}$ we obtain $\left(a^{-2}+b^{2}\right) / 2 f(a b)=\left(a^{2}+b^{2}\right) / 2 a b ;$ equivalently,

$$
f(a b)=\frac{a b\left(a^{-2}+b^{2}\right)}{a^{2}+b^{2}}\tag{3}
$$

We know however (see (1)) that $f(a b)$ must be either $a b$ or $1 / a b$. If $f(a b)=a b$ then by (3) $a^{-2}+b^{2}=a^{2}+b^{2}$, so that $a=1$. But, as $f(1)=1$, this contradicts the relation $f(a) \neq a$. Likewise, if $f(a b)=1 / a b$ then (3) gives $a^{2} b^{2}\left(a^{-2}+b^{2}\right)=a^{2}+b^{2}$, whence $b=1$, in contradiction to $f(b) \neq 1 / b$. Thus indeed the functions listed in (2) are the only two solutions.

Final answer: $$
f(x)=x \quad \text { for all } x>0 \quad \text { or } \quad f(x)=\frac{1}{x} \quad \text { for all } x>0
$$
Subfield: Algebra


Question: 
Prove the inequality

$$
\frac{x^{2}}{(x-1)^{2}}+\frac{y^{2}}{(y-1)^{2}}+\frac{z^{2}}{(z-1)^{2}} \geq 1
$$

for real numbers $x, y, z \neq 1$ satisfying the condition $x y z=1$.

Solution:
We start with the substitution

$$
\frac{x}{x-1}=a, \quad \frac{y}{y-1}=b, \quad \frac{z}{z-1}=c, \quad \text { i.e., } \quad x=\frac{a}{a-1}, \quad y=\frac{b}{b-1}, \quad z=\frac{c}{c-1}
$$

The inequality to be proved reads $a^{2}+b^{2}+c^{2} \geq 1$. The new variables are subject to the constraints $a, b, c \neq 1$ and the following one coming from the condition $x y z=1$,

$$
(a-1)(b-1)(c-1)=a b c .
$$

This is successively equivalent to

$$
\begin{aligned}
a+b+c-1 & =a b+b c+c a, \\
2(a+b+c-1) & =(a+b+c)^{2}-\left(a^{2}+b^{2}+c^{2}\right), \\
a^{2}+b^{2}+c^{2}-2 & =(a+b+c)^{2}-2(a+b+c), \\
a^{2}+b^{2}+c^{2}-1 & =(a+b+c-1)^{2} .
\end{aligned}
$$

Thus indeed $a^{2}+b^{2}+c^{2} \geq 1$, as desired.
Without changing variables, just setting $z=1 / x y$ and clearing fractions, the proposed inequality takes the form

$$
(x y-1)^{2}\left(x^{2}(y-1)^{2}+y^{2}(x-1)^{2}\right)+(x-1)^{2}(y-1)^{2} \geq(x-1)^{2}(y-1)^{2}(x y-1)^{2} .
$$

With the notation $p=x+y, q=x y$ this becomes, after lengthy routine manipulation and a lot of cancellation

$$
q^{4}-6 q^{3}+2 p q^{2}+9 q^{2}-6 p q+p^{2} \geq 0
$$

It is not hard to notice that the expression on the left is just $\left(q^{2}-3 q+p\right)^{2}$, hence nonnegative.

(Without introducing $p$ and $q$, one is of course led with some more work to the same expression, just written in terms of $x$ and $y$; but then it is not that easy to see that it is a square.)
Subfield: Algebra


Question: 
Show that there are infinitely many triples of rational numbers $x, y, z$ for which this inequality turns into equality.

Solution:
From the equation $a^{2}+b^{2}+c^{2}-1=(a+b+c-1)^{2}$ we see that the proposed inequality becomes an equality if and only if both sums $a^{2}+b^{2}+c^{2}$ and $a+b+c$ have value 1 . The first of them is equal to $(a+b+c)^{2}-2(a b+b c+c a)$. So the instances of equality are described by the system of two equations

$$
a+b+c=1, \quad a b+b c+c a=0
$$

plus the constraint $a, b, c \neq 1$. Elimination of $c$ leads to $a^{2}+a b+b^{2}=a+b$, which we regard as a quadratic equation in $b$,

$$
b^{2}+(a-1) b+a(a-1)=0
$$

with discriminant

$$
\Delta=(a-1)^{2}-4 a(a-1)=(1-a)(1+3 a)
$$

We are looking for rational triples $(a, b, c)$; it will suffice to have $a$ rational such that $1-a$ and $1+3 a$ are both squares of rational numbers (then $\Delta$ will be so too). Set $a=k / m$. We want $m-k$ and $m+3 k$ to be squares of integers. This is achieved for instance by taking $m=k^{2}-k+1$ (clearly nonzero); then $m-k=(k-1)^{2}, m+3 k=(k+1)^{2}$. Note that distinct integers $k$ yield distinct values of $a=k / m$.

And thus, if $k$ is any integer and $m=k^{2}-k+1, a=k / m$ then $\Delta=\left(k^{2}-1\right)^{2} / m^{2}$ and the quadratic equation has rational roots $b=\left(m-k \pm k^{2} \mp 1\right) /(2 m)$. Choose e.g. the larger root,

$$
b=\frac{m-k+k^{2}-1}{2 m}=\frac{m+(m-2)}{2 m}=\frac{m-1}{m} .
$$



Computing $c$ from $a+b+c=1$ then gives $c=(1-k) / m$. The condition $a, b, c \neq 1$ eliminates only $k=0$ and $k=1$. Thus, as $k$ varies over integers greater than 1 , we obtain an infinite family of rational triples $(a, b, c)$-and coming back to the original variables $(x=a /(a-1)$ etc. $)$-an infinite family of rational triples $(x, y, z)$ with the needed property. (A short calculation shows that the resulting triples are $x=-k /(k-1)^{2}, y=k-k^{2}, z=(k-1) / k^{2}$; but the proof was complete without listing them.)
To have equality, one needs $q^{2}-3 q+p=0$. Note that $x$ and $y$ are the roots of the quadratic trinomial (in a formal variable $t$ ): $t^{2}-p t+q$. When $q^{2}-3 q+p=0$, the discriminant equals

$$
\delta=p^{2}-4 q=\left(3 q-q^{2}\right)^{2}-4 q=q(q-1)^{2}(q-4)
$$

Now it suffices to have both $q$ and $q-4$ squares of rational numbers (then $p=3 q-q^{2}$ and $\sqrt{\delta}$ are also rational, and so are the roots of the trinomial). On setting $q=(n / m)^{2}=4+(l / m)^{2}$ the requirement becomes $4 m^{2}+l^{2}=n^{2}$ (with $l, m, n$ being integers). This is just the Pythagorean equation, known to have infinitely many integer solutions.
Subfield: Algebra


Question: Let $a, b, c, d$ be positive real numbers such that

$$
a b c d=1 \quad \text { and } \quad a+b+c+d>\frac{a}{b}+\frac{b}{c}+\frac{c}{d}+\frac{d}{a}
$$

Prove that

$$
a+b+c+d<\frac{b}{a}+\frac{c}{b}+\frac{d}{c}+\frac{a}{d}
$$

Solution:
We show that if $a b c d=1$, the sum $a+b+c+d$ cannot exceed a certain weighted mean of the expressions $\frac{a}{b}+\frac{b}{c}+\frac{c}{d}+\frac{d}{a}$ and $\frac{b}{a}+\frac{c}{b}+\frac{d}{c}+\frac{a}{d}$.

By applying the AM-GM inequality to the numbers $\frac{a}{b}, \frac{a}{b}, \frac{b}{c}$ and $\frac{a}{d}$, we obtain

$$
a=\sqrt[4]{\frac{a^{4}}{a b c d}}=\sqrt[4]{\frac{a}{b} \cdot \frac{a}{b} \cdot \frac{b}{c} \cdot \frac{a}{d}} \leq \frac{1}{4}\left(\frac{a}{b}+\frac{a}{b}+\frac{b}{c}+\frac{a}{d}\right)
$$

Analogously,

$$
b \leq \frac{1}{4}\left(\frac{b}{c}+\frac{b}{c}+\frac{c}{d}+\frac{b}{a}\right), \quad c \leq \frac{1}{4}\left(\frac{c}{d}+\frac{c}{d}+\frac{d}{a}+\frac{c}{b}\right) \quad \text { and } \quad d \leq \frac{1}{4}\left(\frac{d}{a}+\frac{d}{a}+\frac{a}{b}+\frac{d}{c}\right) .
$$

Summing up these estimates yields

$$
a+b+c+d \leq \frac{3}{4}\left(\frac{a}{b}+\frac{b}{c}+\frac{c}{d}+\frac{d}{a}\right)+\frac{1}{4}\left(\frac{b}{a}+\frac{c}{b}+\frac{d}{c}+\frac{a}{d}\right)
$$

In particular, if $a+b+c+d>\frac{a}{b}+\frac{b}{c}+\frac{c}{d}+\frac{d}{a}$ then $a+b+c+d<\frac{b}{a}+\frac{c}{b}+\frac{d}{c}+\frac{a}{d}$.
Subfield: Combinatorics


Question: For every positive integer $n$ determine the number of permutations $\left(a_{1}, a_{2}, \ldots, a_{n}\right)$ of the set $\{1,2, \ldots, n\}$ with the following property:

$$
2\left(a_{1}+a_{2}+\cdots+a_{k}\right) \quad \text { is divisible by } k \text { for } k=1,2, \ldots, n \text {. }
$$

Solution:
For each $n$ let $F_{n}$ be the number of permutations of $\{1,2, \ldots, n\}$ with the required property; call them nice. For $n=1,2,3$ every permutation is nice, so $F_{1}=1, F_{2}=2, F_{3}=6$.

Take an $n>3$ and consider any nice permutation $\left(a_{1}, a_{2}, \ldots, a_{n}\right)$ of $\{1,2, \ldots, n\}$. Then $n-1$ must be a divisor of the number

$$
\begin{aligned}
2\left(a_{1}+a_{2}+\cdots\right. & \left.+a_{n-1}\right)=2\left((1+2+\cdots+n)-a_{n}\right) \\
& =n(n+1)-2 a_{n}=(n+2)(n-1)+\left(2-2 a_{n}\right) .
\end{aligned}
$$

So $2 a_{n}-2$ must be divisible by $n-1$, hence equal to 0 or $n-1$ or $2 n-2$. This means that

$$
a_{n}=1 \quad \text { or } \quad a_{n}=\frac{n+1}{2} \quad \text { or } \quad a_{n}=n \text {. }
$$

Suppose that $a_{n}=(n+1) / 2$. Since the permutation is nice, taking $k=n-2$ we get that $n-2$ has to be a divisor of

$$
\begin{aligned}
2\left(a_{1}+a_{2}+\cdots+a_{n-2}\right) & =2\left((1+2+\cdots+n)-a_{n}-a_{n-1}\right) \\
& =n(n+1)-(n+1)-2 a_{n-1}=(n+2)(n-2)+\left(3-2 a_{n-1}\right) .
\end{aligned}
$$

So $2 a_{n-1}-3$ should be divisible by $n-2$, hence equal to 0 or $n-2$ or $2 n-4$. Obviously 0 and $2 n-4$ are excluded because $2 a_{n-1}-3$ is odd. The remaining possibility $\left(2 a_{n-1}-3=n-2\right)$ leads to $a_{n-1}=(n+1) / 2=a_{n}$, which also cannot hold. This eliminates $(n+1) / 2$ as a possible value of $a_{n}$. Consequently $a_{n}=1$ or $a_{n}=n$.

If $a_{n}=n$ then $\left(a_{1}, a_{2}, \ldots, a_{n-1}\right)$ is a nice permutation of $\{1,2, \ldots, n-1\}$. There are $F_{n-1}$ such permutations. Attaching $n$ to any one of them at the end creates a nice permutation of $\{1,2, \ldots, n\}$.

If $a_{n}=1$ then $\left(a_{1}-1, a_{2}-1, \ldots, a_{n-1}-1\right)$ is a permutation of $\{1,2, \ldots, n-1\}$. It is also nice because the number

$$
2\left(\left(a_{1}-1\right)+\cdots+\left(a_{k}-1\right)\right)=2\left(a_{1}+\cdots+a_{k}\right)-2 k
$$

is divisible by $k$, for any $k \leq n-1$. And again, any one of the $F_{n-1}$ nice permutations $\left(b_{1}, b_{2}, \ldots, b_{n-1}\right)$ of $\{1,2, \ldots, n-1\}$ gives rise to a nice permutation of $\{1,2, \ldots, n\}$ whose last term is 1 , namely $\left(b_{1}+1, b_{2}+1, \ldots, b_{n-1}+1,1\right)$.

The bijective correspondences established in both cases show that there are $F_{n-1}$ nice permutations of $\{1,2, \ldots, n\}$ with the last term 1 and also $F_{n-1}$ nice permutations of $\{1,2, \ldots, n\}$ with the last term $n$. Hence follows the recurrence $F_{n}=2 F_{n-1}$. With the base value $F_{3}=6$ this gives the outcome formula $F_{n}=3 \cdot 2^{n-2}$ for $n \geq 3$.
Subfield: Geometry


Question: Given trapezoid $A B C D$ with parallel sides $A B$ and $C D$, assume that there exist points $E$ on line $B C$ outside segment $B C$, and $F$ inside segment $A D$, such that $\angle D A E=\angle C B F$. Denote by $I$ the point of intersection of $C D$ and $E F$, and by $J$ the point of intersection of $A B$ and $E F$. Let $K$ be the midpoint of segment $E F$; assume it does not lie on line $A B$.

Prove that $I$ belongs to the circumcircle of $A B K$ if and only if $K$ belongs to the circumcircle of $C D J$.

Solution:
Assume that the disposition of points is as in the diagram.

Since $\angle E B F=180^{\circ}-\angle C B F=180^{\circ}-\angle E A F$ by hypothesis, the quadrilateral $A E B F$ is cyclic. Hence $A J \cdot J B=F J \cdot J E$. In view of this equality, $I$ belongs to the circumcircle of $A B K$ if and only if $I J \cdot J K=F J \cdot J E$. Expressing $I J=I F+F J, J E=F E-F J$, and $J K=\frac{1}{2} F E-F J$, we find that $I$ belongs to the circumcircle of $A B K$ if and only if

$$
F J=\frac{I F \cdot F E}{2 I F+F E}
$$

Since $A E B F$ is cyclic and $A B, C D$ are parallel, $\angle F E C=\angle F A B=180^{\circ}-\angle C D F$. Then $C D F E$ is also cyclic, yielding $I D \cdot I C=I F \cdot I E$. It follows that $K$ belongs to the circumcircle of $C D J$ if and only if $I J \cdot I K=I F \cdot I E$. Expressing $I J=I F+F J, I K=I F+\frac{1}{2} F E$, and $I E=I F+F E$, we find that $K$ is on the circumcircle of $C D J$ if and only if

$$
F J=\frac{I F \cdot F E}{2 I F+F E}
$$

The conclusion follows.

<img_3929>