1$ almost perfect if $f(n)=n$. Find all almost perfect numbers.
(Paulius Ašvydis)
First Solution. Alternative way to define $f(n)$ is
$$
f(n)=\sum_{k \mid n, k \geq 1} d(k)
$$
Let $n=p_{1}^{a_{1}} p_{2}^{a_{2}} \cdots p_{r}^{a_{r}}$ be the prime factorisation of $n$. We have $d(n)=\prod_{i=1}^{r}\left(a_{i}+1\right)$.
We prove the function $f$ is multiplicative, in particular, given coprime $n, m$ we have $f(n m)=f(n) f(m)$.
Using $n, m$ are coprime for the second inequality and the fact that function $d$ is multiplicative we get:
$$
f(n m)=\sum_{k \mid n m} d(k)=\sum_{k_{1}\left|n, k_{2}\right| m} d\left(k_{1} k_{2}\right)=\sum_{k_{1}\left|n, k_{2}\right| m} d\left(k_{1}\right) d\left(k_{2}\right)=\left(\sum_{k_{1} \mid n} d\left(k_{1}\right)\right)\left(\sum_{k_{2} \mid n} d\left(k_{2}\right)\right)=f(n) f(m)
$$
If $r=1$ we have $n=p_{1}^{a_{1}}$. We note that divisors of $n$ are $1, p_{1}, p_{1}^{2}, \cdots, p_{1}^{a_{1}}$ so $f(n)=\sum_{i=0}^{a_{1}}(i+1)=\frac{\left(a_{1}+1\right)\left(a_{1}+2\right)}{2}$.
Combining this with the multiplicativity result for $f$ we deduce $f(n)=\prod_{i=1}^{r} \frac{\left(a_{i}+1\right)\left(a_{i}+2\right)}{2}$.
We now prove that for primes $p \geq 5$ and $p=3$ provided $a \geq 3$ we have $f\left(p^{a}\right)=\frac{(a+1)(a+2)}{2}<\frac{2}{3} p^{a}$ by induction on $a$. As a basis $3<\frac{2 p}{3}$ for $p \geq 5$ and $6<\frac{2}{3} \cdot 3^{3}$. For the step it is enough to notice that $\frac{a+3}{a+1} \leq 21$ and prime $p$ we have
$$
f(p n) \leqslant 3 f(n)
$$
The equality holds if and only if $G C D(p, n)=1$. Proof: For every integer $m$ we have that the set of divisors of the number $p m$ is the union of the following two sets:
- set of divisors of $m$,
- set of divisors of $m$ multiplied by $p$.
Also, those two mentioned sets are disjoint if and only if $G C D(p, m)=1$ (if we have that $p, m$ are disjoint, then it is obvious that none of the divisors of $p m$ are in both sets; if they are not coprime, then the number $p$ belongs to both sets).
This is why we have $d(p m) \leqslant 2 d(m)$ and
$$
f(p n)=\sum_{k \mid p n} d(k) \leqslant \sum_{k \mid n} d(k)+\sum_{k \mid n} d(p k) \leqslant f(n)+\sum_{k \mid n} 2 d(k)=3 f(n)
$$
In both inequalities equality holds if and only if sets from before are disjoint, i.e. when $G C D(p, n)=1$.
Also, we simply see that $f\left(2^{k}\right)=d(1)+d(2)+\ldots+d\left(2^{k}\right)=1+2+\ldots+(k+1)=\frac{(k+1)(k+2)}{2}$.
Notice that if for some positive integer $n$ we have $f(n)f(n)$, conclude that there are not almost perfect numbers among their nice multiples. With formula for $f\left(2^{k}\right)$ conclude that for sufficiently big $k$ (when $f\left(2^{k}\right)<2^{k}$ ) this is enough to conclude that there are no more almost perfect numbers. By induction, it is simple to prove that $f\left(2^{k}\right)<2^{k}$ for $k \geqslant 4$. Thus, there are no almost perfect numbers of the form $2^{k} \cdot m$, where $k \geqslant 4$ and $m$ is odd, since they all have $2^{k}$ as their nice divisor. We only have to check the numbers of the form $2^{k} \cdot m$, where where $k \leqslant 3$ and $m$ is odd.
First case: $k=0$
For any odd prime $p$ we have $f(p)=d(1)+d(p)=3 \leqslant p$. From that we see that $n=3$ is solution. Moreover, we do not have any more solutions: if some odd number has a prime divisor different from 3 , since $f(p)5$ then we have $2 p>f(2 p)$, so for all almost perfect numbers of the form $2^{1} \cdot m$ number $m$ has to have prime divisors 3 and/or 5 .
We directly see that neither 6 or 10 is almost perfect. So, in this case, almost perfect number has to have a nice divisor of the form $2 \cdot 9,2 \cdot 15$ or $2 \cdot 25$. For $n=18$ we have another solution, in other two cases we have inequality $f(n)5$ then we have $4 p>f(4 p)$, so for all almost perfect numbers of the form $2^{1} \cdot m$ number $m$ has to have prime divisors 3 and /or 5 .
We directly see that neither 12 or 20 is almost perfect. So, in this case, almost perfect number has to have a nice divisor of the form $4 \cdot 9,4 \cdot 15$ or $4 \cdot 25$. For $n=36$ we have another solution, in other two cases we have inequality $f(n) Senior Category
## Problems and Solutions
Problem 1. $A=\{a, b, c\}$ is a set containing three positive integers. Prove that we can find a set $B \subset A$, $B=\{x, y\}$ such that for all odd positive integers $m, n$ we have
$$
10 \mid x^{m} y^{n}-x^{n} y^{m}
$$
(Tomi Dimovski)
Solution. Let $f(x, y)=x^{m} y^{n}-x^{n} y^{m}$. If $n=m$, the problem statement will be fulfilled no matter how we choose $B$ so from now on, without loss of generality, we consider $n>m$. Since $m$ and $n$ are both odd, we have that $n-m$ is even and we get
$$
\begin{gathered}
f(x, y)=x^{m} y^{m}\left(y^{n-m}-x^{n-m}\right) \\
\Longrightarrow f(x, y)=x^{m} y^{m}\left(y^{2}-x^{2}\right) Q(x, y) \\
\Longrightarrow f(x, y)=x^{m} y^{m}(y-x)(y+x) Q(x, y)
\end{gathered}
$$
where $Q(x, y)=y^{n-m-2}+y^{n-m-4} x^{2}+\cdots+x^{n-m-2}$.
Now if one of $x, y$ is even, $f(x, y)$ is even. If both are odd, then $f(x, y)$ is again even since $x+y$ and $x-y$ are even in that case. This shows that we only need to consider divisibility by 5 . If $A$ contains at least one element divisible by 5 , we can put it in $B$ and that will give us the solution easily. Now we consider the case when none of the elements in $A$ is divisible by 5. If some two numbers in $A$ give the same remainder modulo 5, we can choose them and then $x-y$ will be divisible by 5 which solves the problem. Now we consider the case when all remainders modulo 5 in $A$ are different. Take a look at the pairs $(1,4)$ and $(2,3)$. Since we have three different remainders modulo 5 in $A$, by pigeonhole principle one of these pairs has to be completely in $A$ (when elements are considered modulo 5). Then if we pick the numbers from $A$ that correspond to those two remainders we get that $x+y$ is divisible by 5 so the problem statement is fulfilled again. This completes the proof.
Problem 2. Let $a, b, c$ be positive real numbers such that $a b c=1$. Prove that
$$
\frac{a+b+c+3}{4} \geqslant \frac{1}{a+b}+\frac{1}{b+c}+\frac{1}{c+a}
$$
(Dimitar Trenevski)
First Solution. Rewrite the left hand side of inequality in following way:
$$
\frac{a+b+c+3}{4}=\frac{a+b+c+3}{4 \sqrt{a b c}}=\frac{a+1}{4 \sqrt{a b c}}+\frac{b+1}{4 \sqrt{a b c}}+\frac{c+1}{4 \sqrt{a b c}}
$$
Rewrite denominators:
$$
\frac{a+1}{4 \sqrt{a b c}}+\frac{b+1}{4 \sqrt{a b c}}+\frac{c+1}{4 \sqrt{a b c}}=\frac{a+1}{2 \sqrt{a b \cdot c}+2 \sqrt{a c \cdot b}}+\frac{b+1}{2 \sqrt{b c \cdot a}+2 \sqrt{a b \cdot c}}+\frac{c+1}{2 \sqrt{a c \cdot b}+2 \sqrt{b c \cdot a}}
$$
and then by artithmetic mean - geometric mean inequality, we have
$=\frac{a+1}{2 \sqrt{a b \cdot c}+2 \sqrt{a c \cdot b}}+\frac{b+1}{2 \sqrt{b c \cdot a}+2 \sqrt{a b \cdot c}}+\frac{c+1}{2 \sqrt{a c \cdot b}+2 \sqrt{b c \cdot a}} \geqslant \frac{a+1}{a b+c+a c+b}+\frac{b+1}{b c+a+a b+c}+\frac{c+1}{a c+b+b c+a}$.
This problem is now solved, because
$$
\begin{gathered}
\frac{a+1}{a b+c+a c+b}+\frac{b+1}{b c+a+a b+c}+\frac{c+1}{a c+b+b c+a}=\frac{a+1}{(a+1)(b+c)}+\frac{b+1}{(b+1)(a+c)}+\frac{c+1}{(c+1)(a+b)}= \\
=\frac{1}{a+b}+\frac{1}{b+c}+\frac{1}{c+a}
\end{gathered}
$$
Second Solution. We introduce change of variables: $a=x^{3}, b=y^{3}, c=z^{3}$. We now have the condition $x y z=1$. We apply Schur inequality (with exponent $r=1$ ) to the numerator of the left hand side:
$$
x^{3}+y^{3}+z^{3}+3 x y z \geqslant x^{2} y+x^{2} z+y^{2} x+y^{2} z+z^{2} x+z^{2} y
$$
to obtain inequality
$$
\frac{x^{2} y+x^{2} z+y^{2} x+y^{2} z+z^{2} x+z^{2} y}{4} \geqslant \frac{1}{x^{3}+y^{3}}+\frac{1}{y^{3}+z^{3}}+\frac{1}{z^{3}+x^{3}}
$$
We apply arithmetic mean - geometric mean inequality for the denominators of the right hand side:
$$
x^{3}+y^{3} \geqslant 2 x^{3 / 2} y^{3 / 2} \Longrightarrow \frac{1}{x^{3}+y^{3}} \leqslant \frac{1}{2 x^{3 / 2} y^{3 / 2}}=\frac{1}{2} z^{2} \sqrt{y z}
$$
and similarly to the other terms. We now have to prove
$$
\frac{x^{2} y+x^{2} z+y^{2} x+y^{2} z+z^{2} x+z^{2} y}{2} \geqslant x^{2} \sqrt{y z}+y^{2} \sqrt{x z}+z^{2} \sqrt{x y}
$$
We apply arithmetic mean - geometric mean inequality in pairs on the left hand side:
$$
\begin{aligned}
& \frac{x^{2} y+x^{2} z}{2} \geqslant x^{2} \sqrt{y z} \\
& \frac{y^{2} x+y^{2} z}{2} \geqslant y^{2} \sqrt{x z} \\
& \frac{z^{2} x+z^{2} y}{2} \geqslant z^{2} \sqrt{x y}
\end{aligned}
$$
Summing up inequalities from above finishes the proof.
Problem 3. Circles $k_{1}$ and $k_{2}$ intersect in points $A$ and $B$, such that $k_{1}$ passes through the center $O$ of the circle $k_{2}$. The line $p$ intersects $k_{1}$ in points $K$ and $O$ and $k_{2}$ in points $L$ and $M$, such that the point $L$ is between $K$ and $O$. The point $P$ is orthogonal projection of the point $L$ to the line $A B$. Prove that the line $K P$ is parallel to the $M$-median of the triangle $A B M$.
(Matko Ljulj)
Solution. Let the point $C$ be the midpoint of the line segment $\overline{A B}$. We have to prove $M C \| K P$.

Let us introduce angle $\alpha:=\angle B K A$. Notice that
$$
\angle B L A=180-\angle B M A=180-\frac{1}{2} \angle B O A=180-\frac{1}{2}(180-\angle B K A)=90+\frac{1}{2} \alpha
$$
Also, notice that the point $O$ is midpoint of the arc $\overparen{A B}$. Thus the line $K O$ is bisector of the angle $\angle B K A$. From the two claims above, we deduce that $L$ is incenter of the triangle $A B K$. Moreover, notice that $\overline{M L}$ is diameter of the circle $k_{2}$, thus $\angle A B M=90$. Since $B L$ is angle bisector of the angle $\angle A B K$, we deduce that $B M$ is exterior angle bisector of the same angle. Thus, since $M$ lies on angle bi sector $K M$ and exterior angle bisector $B M, M$ is the center of the excircle for the triangle $A B K$. Thus, we have to prove that the line passing through the incenter $L$ of the triangle $A B K$ and point of the tangency of incircle of the same triangle is parallel to the line passing through the center of the excircle $M$ and the midpoint $C$ of the line segment $\overline{A B}$. This is a well known lemma, which completes the proof.
Problem 4. A group of mathematicians is attending a conference. We say that a mathematician is $k$-content if he is in the room with at least $k$ people he admires or if he is admired by at least $k$ other people in the room. It is known that when all participants are in the same room then they are all at least $3 k+1$-content. Prove that you can assign everyone into one of the 2 rooms in a way that everyone is at least $k$-content in his room and neither room is empty. Admiration is not necessarily mutual and no one admires himself.
(Matija Bucić)
Solution. We will for simplicity and clarity of presentation use some basic graph theoretic terms, this is in no way essential.
We represent the situation by a directed graph (abbr. digraph) $G(V, E)$ where each vertex $v \in V(G)$ represents a mathematician and each edge $e \in E(G)$ represents an admiration relation. Given $v \in V(G)$ we define out-degree of $v$ denoted $o(v)$ as the number of edges starting in $v$ (so the number of mathematicians $v$ admires) and in-degree $i(v)$ as the number of edges ending in $v$ (so the number of mathematicians who admire $v$ ). Given $X \subseteq V$ by $G(X)$ we denote the induced subgraph (a graph with vertex set $X$ and edges inherited from $G$ ). We say that a digraph is a $k$-digraph if for every $v \in V(G)$ we have $i(v) \geq k$ or $o(v) \geq k$.
So the question can be reformulated as: Given $G$ is a $3 k+1$-digraph we can split its vertices into 2 vertex disjoint classes such that each induced subgraph on class is a $k$ digraph.
We call a subset $X$ of vertices of $G k$-tight if for any $Y \subseteq X$ we have a vertex $v \in Y$ such that $i_{G(Y)}(v) \leq k$ and $o_{G(Y)}(v) \leq k$. A partition of $V,\left(A_{1}, A_{2}\right)$ is feasible if $A_{1}$ is $k$-tight and $A_{2}$ is $k$-tight.
We first assume there are no feasible partitions.
In this case consider a minimal size subset $A_{1} \subseteq V(G)$ subject to $G\left(A_{1}\right)$ being a $k$-digraph, we define $A_{2} \equiv V(G)-A_{1}$. Given a subset $X \subset A_{1}, G(X)$ is not a $k$-digraph so there is a vertex $v \in X$ such that $o_{G(X)}(v)0$. By our assumption $(A, B \cup C)$ is not a solution pair so there is some $x \in C$ such that $o_{G(B \cup C)}(x), i_{G(B \cup C)}(x)k+1$ or $i_{G(A \cup\{x\})}(x)>k+1$ so in particular $(A \cup\{x\}, B)$ is a solution pair contradicting maximality and completing our argument.
Hence we are left with the case in which we have at least one feasible partition. We pick the feasible partition $(A, B)$ maximizing $w(A, B)=|E(G(A))|+|E(G(B))|$. The fact that $A$ is $k$-tight implies there is an $x$ with $o_{G(A)}(x) \leq k$, $i_{G(A)}(x) \leq k$ so $x$ needs to have at least $k+1$ edges in or out of $B$ so $|B| \geq k+1$ and by symmetry $|A| \geq k+1$.
We now prove that there exist an $X \subseteq A$ such that $G(X)$ is a $k$-digraph, by contradiction. Assuming the opposite we notice that for any $x \in B, B-\{x\}$ is still $k$-tight while $B$ being $k$-tight implies there is an $x \in B$ such that $o_{G(B)}(x) \leq k$, $i_{G(B)}(x) \leq k$ so for this $x$ we have $A \cup\{x\}$ is also $k$-tight. Hence, for $A^{\prime}=A \cup\{x\}$ and $B^{\prime}=B-\{x\},\left(A^{\prime}, B^{\prime}\right)$ is a feasible partition. We considering the change in edges which moving $x$ causes we have $w\left(A^{\prime}, B^{\prime}\right)-w(A, B) \geq 3 k+1-k-k-k=1$ as we know $i_{G}(x) \geq 3 k+1$ or $o_{G}(x) \geq 3 k+1$ so moving $x$ from $B$ to $A$ increases number of edges in $A$ by at least $3 k+1-k$ while the choice of $x$ in $B$ means we lose at most $k+k$ edges in $B$. This is a contradiction to maximality of $(A, B)$.
Analogously we can find $Y \subseteq B$ with $G(Y)$ a $k$-digraph. Now applying the above proposition yet again we are done.
Remark: The same argument with slightly modified weight function can be used to show the result for non symmetric rooms, in particular if the graph is a $k+l+\max (k, l)+1$ digraph it can be partitioned into $k$ - digraph and $l$ digraph parts.