solution:
Since $x_{101-i}=\frac{101-i}{101}=1-\frac{i}{101}=1-x_{i}$ and

$$
1-3 x_{i}+3 x_{i}^{2}=\left(1-3 x_{i}+3 x_{i}^{2}-x_{i}^{3}\right)+x_{i}^{3}=\left(1-x_{i}\right)^{3}+x_{i}^{3}=x_{101-i}^{3}+x_{i}^{3},
$$

we have, by replacing $i$ by $101-i$ in the second sum,

$$
2 S=S+S=\sum_{i=0}^{101} \frac{x_{i}^{3}}{x_{101-i}^{3}+x_{i}^{3}}+\sum_{i=0}^{101} \frac{x_{101-i}^{3}}{x_{i}^{3}+x_{101-i}^{3}}=\sum_{i=0}^{101} \frac{x_{i}^{3}+x_{101-i}^{3}}{x_{101-i}^{3}+x_{i}^{3}}=102,
$$

so $S=51$.

problem_match: # Problem 1

solution_match: # Solution


problem:
Given the following arrangement of circles:
![](https://cdn.mathpix.com/cropped/2024_11_22_a2c6ce53d2466fb5c44ag-2.jpg?height=358&width=401&top_left_y=264&top_left_x=793)

Each of the numbers $1,2, \ldots, 9$ is to be written into one of these circles, so that each circle contains exactly one of these numbers and
(i) the sums of the four numbers on each side of the triangle are equal;
(ii) the sums of squares of the four numbers on each side of the triangle are equal.

Find all ways in which this can be done.
Answer: The only solutions are
![](https://cdn.mathpix.com/cropped/2024_11_22_a2c6ce53d2466fb5c44ag-2.jpg?height=361&width=404&top_left_y=1076&top_left_x=792)
and the ones generated by permuting the vertices, adjusting sides and exchanging the two middle numbers on each side.

solution:
Let $a, b$, and $c$ be the numbers in the vertices of the triangular arrangement. Let $s$ be the sum of the numbers on each side and $t$ be the sum of the squares of the numbers on each side. Summing the numbers (or their squares) on the three sides repeats each once the numbers on the vertices (or their squares):

$$
\begin{gathered}
3 s=a+b+c+(1+2+\cdots+9)=a+b+c+45 \\
3 t=a^{2}+b^{2}+c^{2}+\left(1^{2}+2^{2}+\cdots+9^{2}\right)=a^{2}+b^{2}+c^{2}+285
\end{gathered}
$$

At any rate, $a+b+c$ and $a^{2}+b^{2}+c^{2}$ are both multiples of 3 . Since $x^{2} \equiv 0,1(\bmod 3)$, either $a, b, c$ are all multiples of 3 or none is a multiple of 3 . If two of them are $1,2 \bmod 3$ then $a+b+c \equiv 0(\bmod 3)$ implies that the other should be a multiple of 3 , which is not possible. Thus $a, b, c$ are all congruent modulo 3 , that is,

$$
\{a, b, c\}=\{3,6,9\}, \quad\{1,4,7\}, \quad \text { or } \quad\{2,5,8\}
$$

Case 1: $\{a, b, c\}=\{3,6,9\}$. Then $3 t=3^{2}+6^{2}+9^{2}+285 \Longleftrightarrow t=137$.
![](https://cdn.mathpix.com/cropped/2024_11_22_a2c6ce53d2466fb5c44ag-2.jpg?height=372&width=409&top_left_y=2395&top_left_x=789)

In this case $x^{2}+y^{2}+3^{2}+9^{2}=137 \Longleftrightarrow x^{2}+y^{2}=47$. However, 47 cannot be written as the sum of two squares. One can check manually, or realize that $47 \equiv 3(\bmod 4)$, and since $x^{2}, y^{2} \equiv 0,1(\bmod 4), x^{2}+y^{2} \equiv 0,1,2(\bmod 4)$ cannot be 47.
Hence there are no solutions in this case.
Case 2: $\{a, b, c\}=\{1,4,7\}$. Then $3 t=1^{2}+4^{2}+7^{2}+285 \Longleftrightarrow t=117$.
![](https://cdn.mathpix.com/cropped/2024_11_22_a2c6ce53d2466fb5c44ag-3.jpg?height=360&width=398&top_left_y=434&top_left_x=795)

In this case $x^{2}+y^{2}+1^{2}+7^{2}=117 \Longleftrightarrow x^{2}+y^{2}=67 \equiv 3(\bmod 4)$, and as in the previous case there are no solutions.
Case 3: $\{a, b, c\}=\{2,5,8\}$. Then $3 t=2^{2}+5^{2}+8^{2}+285 \Longleftrightarrow t=126$.
![](https://cdn.mathpix.com/cropped/2024_11_22_a2c6ce53d2466fb5c44ag-3.jpg?height=355&width=401&top_left_y=1025&top_left_x=793)

Then

$$
\left\{\begin{array} { c }
{ x ^ { 2 } + y ^ { 2 } + 2 ^ { 2 } + 8 ^ { 2 } = 1 2 6 } \\
{ t ^ { 2 } + u ^ { 2 } + 2 ^ { 2 } + 5 ^ { 2 } = 1 2 6 } \\
{ m ^ { 2 } + n ^ { 2 } + 5 ^ { 2 } + 8 ^ { 2 } = 1 2 6 }
\end{array} \Longleftrightarrow \left\{\begin{array}{c}
x^{2}+y^{2}=58 \\
t^{2}+u^{2}=97 \\
m^{2}+n^{2}=37
\end{array}\right.\right.
$$

The only solutions to $t^{2}+u^{2}=97$ and $m^{2}+n^{2}=37$ are $\{t, u\}=\{4,9\}$ and $\{m, n\}=\{1,6\}$, respectively (again, one can check manually.) Then $\{x, y\}=\{3,7\}$, and the solutions are
![](https://cdn.mathpix.com/cropped/2024_11_22_a2c6ce53d2466fb5c44ag-3.jpg?height=353&width=392&top_left_y=1751&top_left_x=798)
and the ones generated by permuting the vertices, adjusting sides and exchanging the two middle numbers on each side. There are $3!\cdot 2^{3}=48$ such solutions.

problem_match: # Problem 2


problem: Let $A B C$ be a triangle. Let $M$ and $N$ be the points in which the median and angle bisector, respectively, at $A$ meet the side $B C$. Let $Q$ and $P$ be the points in which the perpendicular at $N$ to $N A$ meets $M A$ and $B A$, respectively, and $O$ be the point in which the perpendicular at $P$ to $B A$ meets $A N$ produced. Prove that $Q O$ is perpendicular to $B C$.

solution:
Let $A N$ meet the circumcircle of $A B C$ at point $K$, the midpoint of arc $B C$ that does not contain $A$.
![](https://cdn.mathpix.com/cropped/2024_11_22_a2c6ce53d2466fb5c44ag-4.jpg?height=775&width=869&top_left_y=572&top_left_x=562)

The orthogonal projection of $K$ onto side $B C$ is $M$. Let $R$ and $S$ be the orthogonal projections of $K$ onto lines $A B$ and $A C$, respectively. Points $R, M$, and $S$ lie in the Simson line of $K$ with respect to $A B C$. Since $K$ is in the bisector of $\angle B A C, A R K S$ is a kite, and the Simson line $R M S$ is perpendicular to $A N$, and therefore parallel to $P Q$.
Now consider the homothety with center $A$ that takes $O$ to $K$. Since $O P \perp A B$ and $K R \perp A B$, $O P$ and $K R$ are parallel, which means that $P$ is taken to $R$. Finally, line $P Q$ is parallel to line $R S$, so line $P Q$ is taken to line $R S$ by the homothety. Then $Q$ is taken to $M$, and since $O$ is taken to $K$, line $O Q$ is taken to line $M K$. We are done now: this means that $O Q$ is parallel to $M K$, which is perpendicular to $B C$ (it is its perpendicular bisector, as $M B=M C$ and $K B=K C$.)

problem_match: # Problem 3

solution_match: # Solution 1


solution:
Consider a cartesian plane with $A=(0,0)$ as the origin and the bisector $A N$ as $x$-axis. Thus $A B$ has equation $y=m x$ and $A C$ has equation $y=-m x$. Let $B=(b, m b)$ and $C=(c,-m c)$. By symmetry, the problem is immediate if $A B=A C$, that is, if $b=c$. Suppose that $b \neq c$ from now on. Line $B C$ has slope $\frac{m b-(-m c)}{b-c}=\frac{m(b+c)}{b-c}$. Let $N=(n, 0)$.
Point $M$ is the midpoint $\left(\frac{b+c}{2}, \frac{m b-m c}{2}\right)$ of $B C$, so $A M$ has slope $\frac{m(b-c)}{b+c}$.
The line through $N$ that is perpendicular to the $x$-axis $A N$ is $x=n$. Therefore

$$
P=(n, m n) \quad \text { and } \quad Q=\left(n, \frac{m(b-c) n}{b+c}\right) .
$$

In the right triangle $A P O$, with altitude $A N, A N \cdot A O=A P^{2}$. Thus

$$
n \cdot A O=(0-n)^{2}+(0-m n)^{2} \Longleftrightarrow A O=n\left(m^{2}+1\right) \Longrightarrow O=\left(n\left(m^{2}+1\right), 0\right)
$$

Finally, the slope of $O Q$ is

$$
\frac{\frac{m(b-c) n}{b+c}-0}{n-n\left(m^{2}+1\right)}=-\frac{b-c}{(b+c) m}
$$

Since the product of the slopes of $O Q$ and $B C$ is

$$
-\frac{b-c}{(b+c) m} \cdot \frac{m(b+c)}{b-c}=-1
$$

$O Q$ and $B C$ are perpendicular, and we are done.
Comment: The second solution shows that $N$ can be any point in the bisector of $\angle A$. In fact, if we move $N$ in the bisector and construct $O, P$ and $Q$ accordingly, then all lines $O Q$ obtained are parallel: just consider a homothety with center $A$ and variable ratios.

solution_match: # Solution 2


problem:
Let $n, k$ be given positive integers with $n>k$. Prove that

$$
\frac{1}{n+1} \cdot \frac{n^{n}}{k^{k}(n-k)^{n-k}}<\frac{n!}{k!(n-k)!}<\frac{n^{n}}{k^{k}(n-k)^{n-k}} .
$$

solution:
The inequality is equivalent to

$$
\frac{n^{n}}{n+1}<\binom{n}{k} k^{k}(n-k)^{n-k}<n^{n}
$$

which suggests investigating the binomial expansion of

$$
n^{n}=((n-k)+k)^{n}=\sum_{i=0}^{n}\binom{n}{i}(n-k)^{n-i} k^{i}
$$

The $(k+1)$ th term $T_{k+1}$ of the expansion is $\binom{n}{k} k^{k}(n-k)^{n-k}$, and all terms in the expansion are positive, which implies the right inequality.
Now, for $1 \leq i \leq n$,

$$
\frac{T_{i+1}}{T_{i}}=\frac{\binom{n}{i}(n-k)^{n-i} k^{i}}{\binom{n}{i-1}(n-k)^{n-i+1} k^{i-1}}=\frac{(n-i+1) k}{i(n-k)}
$$

and

$$
\frac{T_{i+1}}{T_{i}}>1 \Longleftrightarrow(n-i+1) k>i(n-k) \Longleftrightarrow i<k+\frac{k}{n} \Longleftrightarrow i \leq k
$$

This means that

$$
T_{1}<T_{2}<\cdots<T_{k+1}>T_{k+2}>\cdots>T_{n+1}
$$

that is, $T_{k+1}=\binom{n}{k} k^{k}(n-k)^{n-k}$ is the largest term in the expansion. The maximum term is greater that the average, which is the sum $n^{n}$ divided by the quantity $n+1$, therefore

$$
\binom{n}{k} k^{k}(n-k)^{n-k}>\frac{n^{n}}{n+1}
$$

as required.
Comment: If we divide further by $n^{n}$ one finds

$$
\frac{1}{n+1}<\binom{n}{k}\left(\frac{k}{n}\right)^{k}\left(1-\frac{k}{n}\right)^{n-k}<1
$$

The middle term is the probability $P(X=k)$ of $k$ successes in a binomial distribution with $n$ trials and success probability $p=\frac{k}{n}$. The right inequality is immediate from the fact that $P(X=k)$ is not the only possible event in this distribution, and the left inequality comes from the fact that the mode of the binomial distribution are given by $\lfloor(n+1) p\rfloor=\left\lfloor(n+1) \frac{k}{n}\right\rfloor=k$ and $\lceil(n+1) p-1\rceil=k$. However, the proof of this fact is identical to the above solution.

problem_match: # Problem 4


problem:
Given a permutation $\left(a_{0}, a_{1}, \ldots, a_{n}\right)$ of the sequence $0,1, \ldots, n$. A transposition of $a_{i}$ with $a_{j}$ is called legal if $a_{i}=0$ for $i>0$, and $a_{i-1}+1=a_{j}$. The permutation $\left(a_{0}, a_{1}, \ldots, a_{n}\right)$ is called regular if after a number of legal transpositions it becomes $(1,2, \ldots, n, 0)$. For which numbers $n$ is the permutation $(1, n, n-1, \ldots, 3,2,0)$ regular?

Answer: $n=2$ and $n=2^{k}-1, k$ positive integer.

solution:
A legal transposition consists of looking at the number immediately before 0 and exchanging 0 and its successor; therefore, we can perform at most one legal transposition to any permutation, and a legal transposition is not possible only and if only 0 is preceded by $n$.
If $n=1$ or $n=2$ there is nothing to do, so $n=1=2^{1}-1$ and $n=2$ are solutions. Suppose that $n>3$ in the following.
Call a pass a maximal sequence of legal transpositions that move 0 to the left. We first illustrate what happens in the case $n=15$, which is large enough to visualize what is going on. The first pass is

$$
\begin{aligned}
& (1,15,14,13,12,11,10,9,8,7,6,5,4,3,2,0) \\
& (1,15,14,13,12,11,10,9,8,7,6,5,4,0,2,3) \\
& (1,15,14,13,12,11,10,9,8,7,6,0,4,5,2,3) \\
& (1,15,14,13,12,11,10,9,8,0,6,7,4,5,2,3) \\
& (1,15,14,13,12,11,10,0,8,9,6,7,4,5,2,3) \\
& (1,15,14,13,12,0,10,11,8,9,6,7,4,5,2,3) \\
& (1,15,14,0,12,13,10,11,8,9,6,7,4,5,2,3) \\
& (1,0,14,15,12,13,10,11,8,9,6,7,4,5,2,3)
\end{aligned}
$$

After exchanging 0 and 2, the second pass is

$$
\begin{aligned}
& (1,2,14,15,12,13,10,11,8,9,6,7,4,5,0,3) \\
& (1,2,14,15,12,13, \mathbf{1 0}, 11,8,9,0,7,4,5,6,3) \\
& (1,2, \mathbf{1 4}, 15,12,13,0,11,8,9,10,7,4,5,6,3) \\
& (1,2,0,15,12,13,14,11,8,9,10,7,4,5,6,3)
\end{aligned}
$$

After exchanging 0 and 3 , the third pass is

$$
\begin{aligned}
& (1,2,3,15,12,13,14,11,8,9,10,7,4,5,6,0) \\
& (1,2,3,15,12,13,14,11,8,9,10,0,4,5,6,7) \\
& (1,2,3,15,12,13,14,0,8,9,10,11,4,5,6,7) \\
& (1,2,3,0,12,13,14,15,8,9,10,11,4,5,6,7)
\end{aligned}
$$

After exchanging 0 and 4, the fourth pass is

$$
\begin{aligned}
& (1,2,3,4,12,13,14,15,8,9,10,11,0,5,6,7) \\
& (1,2,3,4,0,13,14,15,8,9,10,11,12,5,6,7)
\end{aligned}
$$

And then one can successively perform the operations to eventually find

$$
(1,2,3,4,5,6,7,0,8,9,10,11,12,13,14,15)
$$

after which 0 will move one unit to the right with each transposition, and $n=15$ is a solution. The general case follows.

Case 1: $n>2$ even: After the first pass, in which 0 is transposed successively with $3,5, \ldots, n-1$, after which 0 is right after $n$, and no other legal transposition can be performed. So $n$ is not a solution in this case.
Case 2: $n=2^{k}-1$ : Denote $N=n+1, R=2^{r},[a: b]=(a, a+1, a+2, \ldots, b)$, and concatenation by a comma. Let $P_{r}$ be the permutation

$$
[1: R-1],(0),[N-R: N-1],[N-2 R: N-R-1], \ldots,[2 R: 3 R-1],[R: 2 R-1]
$$

$P_{r}$ is formed by the blocks $[1: R-1],(0)$, and other $2^{k-r}-1$ blocks of size $R=2^{r}$ with consecutive numbers, beginning with $t R$ and finishing with $(t+1) R-1$, in decreasing order of $t$. Also define $P_{0}$ as the initial permutation.
Then it can be verified that $P_{r+1}$ is obtained from $P_{r}$ after a number of legal transpositions: it can be easily verified that $P_{0}$ leads to $P_{1}$, as 0 is transposed successively with $3,5, \ldots, n-1$, shifting cyclically all numbers with even indices; this is $P_{1}$.
Starting from $P_{r}, r>0$, 0 is successively transposed with $R, 3 R, \ldots, N-R$. The numbers $0, N-R, N-3 R, \ldots, 3 R, R$ are cyclically shifted. This means that $R$ precedes 0 , and the blocks become

$$
\begin{gathered}
{[1: R],(0),[N-R+1: N-1],[N-2 R: N-R],[N-3 R+1: N-2 R-1], \ldots,} \\
{[3 R+1: 4 R-1],[2 R: 3 R],[R+1: 2 R-1]}
\end{gathered}
$$

Note that the first block and the ones on even positions greater than 2 have one more number and the other blocks have one less number.
Now $0, N-R+1, N-3 R+1, \ldots, 3 R+1, R+1$ are shifted. Note that, for every $i$ th block, $i$ odd greater than 1 , the first number is cyclically shifted, and the blocks become

$$
\begin{gathered}
{[1: R+1],(0),[N-R+2: N-1],[N-2 R: N-R+1],[N-3 R+2: N-2 R-1], \ldots,} \\
{[3 R+1: 4 R-1],[2 R: 3 R+1],[R+2: 2 R-1]}
\end{gathered}
$$

The same phenomenom happened: the first block and the ones on even positions greater than 2 have one more number and the other blocks have one less number. This pattern continues: $0, N-R+u, N-3 R+u, \ldots, R+u$ are shifted, $u=0,1,2, \ldots, R-1$, the first block and the ones on even positions greater than 2 have one more number and the other blocks have one less number, until they vanish. We finish with

$$
[1: 2 R-1],(0),[N-2 R: N-1], \ldots,[2 R: 4 R-1]
$$

which is precisely $P_{r+1}$.
Since $P_{k}=[1: N-1],(0), n=2^{k}-1$ is a solution.
Case 3: $n$ is odd, but is not of the form $2^{k}-1$. Write $n+1$ as $n+1=2^{a}(2 b+1), b \geq 1$, and define $P_{0}, \ldots, P_{a}$ as in the previous case. Since $2^{a}$ divides $N=n+1$, the same rules apply, and we obtain $P_{a}$ :

$$
\left[1: 2^{a}-1\right],(0),\left[N-2^{a}: N-1\right],\left[N-2^{a+1}: N-2^{a}-1\right], \ldots,\left[2^{a+1}: 3 \cdot 2^{a}-1\right],\left[2^{a}: 2^{a+1}-1\right]
$$

But then 0 is transposed with $2^{a}, 3 \cdot 2^{a}, \ldots,(2 b-1) \cdot 2^{a}=N-2^{a+1}$, after which 0 is put immediately after $N-1=n$, and cannot be transposed again. Therefore, $n$ is not a solution. All cases were studied, and so we are done.

Comment: The general problem of finding the number of regular permutations for any $n$ seems to be difficult. A computer finds the first few values

$$
1,2,5,14,47,189,891,4815,29547
$$

which is not catalogued at oeis.org.

problem_match: # Problem 5