Solution: We use the notion of a good number from the previous solution. As above, we also denote by $\nu_{p}(n)$ the exponent of a prime $p$ in the prime decomposition of $n$.  Say that a positive integer $k$ is big if $f(k)>0$. Let $\mathcal{B}$ be the set of big primes, and let $p_{1}<p_{2}<\ldots$ list the elements of $\mathcal{B}$ (this set might be either finite or infinite). By the problem conditions, we have  $$ f(n)=\sum_{i} \nu_{p_{i}}(n) f\left(p_{i}\right) $$  thus, the big numbers are those divisible by at least one big prime. For a positive integer $k$, define its essence $e(k)$ to be the largest product $e$ of (not necessarily different) big primes such that $e \mid k$. In other words,  $$ e(n)=\prod_{p_{i} \in \mathcal{B}} p_{i}^{\nu_{p_{i}}(n)} $$  This yields that $k / e(k)$ is not big, so $f(k)=f(e(k))+f(k / e(k))=f(e(k))$. Lemma. Assume that $n$ is a good number. Then $e(k)=e(n-k)$ for all $k<n$.  Proof. Arguing indirectly, choose a minimal $k$ for which the claim of the lemma is violated. Clearly, $k$ is big, as otherwise $f(k)=f(n-k)=0$ and hence $e(k)=e(n-k)=1$.  There are $t=k / e(k)$ multiples of $e(k)$ in each of the segments $[1, k]$ and $[n-k, n-1]$. On the other hand, there are $t-1$ such multiples on $[1, k-1]$ - and, by minimality of $k$, on $[n-k+1, n-1]$ as well. This yields that $n-k$ is a multiple of $e(k)$. Therefore,  $$ f(e(k))=f(k)=f(n-k)=f(e(k))+f\left(\frac{n-k}{e(k)}\right), $$  so the last summand vanishes, hence $\frac{n-k}{e(k)}$ has no big prime divisors, that is, $e(n-k)=e(k)$. This contradicts our choice.  Back to the problem, assume that $|\mathcal{B}| \geqslant 2$. Take any good number $n>p_{1} p_{2}$, and let $p_{1}^{\alpha}$ be the largest power of $p_{1}$ smaller than $n$, so that $n \leqslant p_{1}^{\alpha+1}<p_{1}^{\alpha} p_{2}$. By the lemma, $e\left(n-p_{1}^{\alpha}\right)=e\left(p_{1}^{\alpha}\right)=p_{1}^{\alpha}$, which yields $p_{1}^{\alpha} \mid n$. Similarly, $p_{2} \mid n$, so that $n \geqslant p_{1}^{\alpha} p_{2}$. This contradiction shows that $|\mathcal{B}| \leqslant 1$, which by (1) yields that $f$ is listed in the answer.


Determine all functions $f$ defined on the set of all positive integers and taking non-negative integer values, satisfying the three conditions: (i) $f(n) \neq 0$ for at least one $n$; (ii) $f(x y)=f(x)+f(y)$ for every positive integers $x$ and $y$; (iii) there are infinitely many positive integers $n$ such that $f(k)=f(n-k)$ for all $k<n$. (Croatia) Answer: The sought functions are those of the form $f(n)=c \cdot \nu_{p}(n)$, where $p$ is some prime, $c$ is a nonnegative integer, and $\nu_{p}(n)$ denotes the exponent of $p$ in the prime decomposition of $n$.

Solution: We have $f\left(\prod p_{i}^{\alpha_{i}}\right)=\sum \alpha_{i} f\left(p_{i}\right)$. Note that  $$ f(n-1)+f(n-2)+\ldots+\ldots f(n-k) \geqslant f(1)+\ldots+f(k) $$  for all $k=1,2, \ldots, n-1$, since the difference LHS-RHS is just $\left.f\binom{n-1}{k}\right)$. Assume that $f(p)>0$. If $f(k)=f(n-k)$ for all $k$, it implies that $\binom{n-1}{k}$ is not divisible by $p$ for all $k=1,2, \ldots, n-2$. It is well known that it implies $n=a \cdot p^{s}, a<p$. If there are two primes $p, q$ such that $f(p)>0, f(q)>0$, there exist only finitely many $n$ which are equal both to $a \cdot p^{s}, a<p$, and $b \cdot q^{t}, b<q$. So there exists at most one such $p$, and therefore $f(n)=C \cdot \nu_{p}(n)$ for some constant $C$.


Solution: We call a function $f: \mathbb{N} \rightarrow \mathbb{N}_{0}$ satisfying (ii) additive. We call a pair $(f, n)$, where $f$ is an additive function and $n \in \mathbb{N}$, good, if for all $k<n$ it holds $f(k)=f(n-k)$. For an additive function $f$ and a prime number $p$ the number $\frac{f(p)}{\ln p}$ is denoted by $g(f, p)$.  Let $(f, n)$ be a good pair such that $f(p)>0$ for at least two primes less than $n$. Let $p_{0}$ be the prime with maximal $g(f, p)$ among all primes $p<n$. Let $a_{0}$ be the maximal exponent such that $p_{0}^{a_{0}}<n$. Then $f(k)<f\left(p_{0}^{a_{0}}\right)$ for all $k<p_{0}^{a_{0}}$. Indeed, if $k=p_{1}^{a_{1}} \ldots p_{m}^{a_{m}}<p_{0}^{a_{0}}$, then  $$ \begin{aligned} f(k) & =a_{1} f\left(p_{1}\right)+\ldots+a_{m} f\left(p_{m}\right)=g\left(f, p_{1}\right) a_{1} \ln p_{1}+\ldots+g\left(f, p_{m}\right) a_{m} \ln a_{m} \\ & <g\left(f, p_{0}\right) a_{0} \ln p_{0}=f\left(p_{0}^{a_{0}}\right) . \end{aligned} $$  Let $n=b p_{0}^{a_{0}}+r$, where $0<r<p_{0}^{a_{0}}$. Then $f(r)=f\left(b p_{0}^{a_{0}}\right) \geqslant f\left(p_{0}^{a_{0}}\right)$. This contradiction shows that $p_{0}^{a_{0}} \mid n$. Then $n=p_{0}^{\nu_{p_{0}}(n)} n^{\prime}$, where $n^{\prime} \leqslant p_{0}$.  The functions $f_{1}(m):=f\left(p_{0}\right) \nu_{p_{0}}(m)$ and $f_{2}:=f-f_{1}$ are additive (obviously $f(m) \geqslant$ $f\left(p_{0}^{\nu_{p_{0}}(m)}\right)=f_{1}(m)$, since $p_{0}^{\nu_{p_{0}}(m)}$ divides $\left.m\right)$. For $k<n, \nu_{p}(k)=\nu_{p}(n-k)$. Hence the pair $\left(f_{2}, n\right)$ is also good. Note that $f_{2}\left(p_{0}\right)=0$.  Choose among all primes $p<n$ the prime $q_{0}$ with maximal $g\left(f_{2}, p\right)$. As above we can prove that $n=q_{0}^{\nu_{0}(n)} n^{\prime \prime}$ with $n^{\prime \prime}<q_{0}$. Since $p_{0} \neq q_{0}$, we get a contradiction. Thus $f(n)=f(p) \cdot \nu_{p}(n)$.


For a positive integer $n$, let $d(n)$ be the number of positive divisors of $n$, and let $\varphi(n)$ be the number of positive integers not exceeding $n$ which are coprime to $n$. Does there exist a constant $C$ such that  $$ \frac{\varphi(d(n))}{d(\varphi(n))} \leqslant C $$  for all $n \geqslant 1$ ? (Cyprus) Answer: No, such constant does not exist.

Solution: Fix $N>1$, let $p_{1}, \ldots, p_{k}$ be all primes between 1 and $N$ and $p_{k+1}, \ldots, p_{k+s}$ be all primes between $N+1$ and $2 N$. Since for $j \leqslant k+s$ all prime divisors of $p_{j}-1$ do not exceed $N$, we have  $$ \prod_{j=1}^{k+s}\left(p_{j}-1\right)=\prod_{i=1}^{k} p_{i}^{c_{i}} $$  with some fixed exponents $c_{1}, \ldots, c_{k}$. Choose a huge prime number $q$ and consider a number  $$ n=\left(p_{1} \cdot \ldots \cdot p_{k}\right)^{q-1} \cdot\left(p_{k+1} \cdot \ldots \cdot p_{k+s}\right) $$  Then  $$ \varphi(d(n))=\varphi\left(q^{k} \cdot 2^{s}\right)=q^{k-1}(q-1) 2^{s-1} $$  and  $$ d(\varphi(n))=d\left(\left(p_{1} \cdot \ldots \cdot p_{k}\right)^{q-2} \prod_{i=1}^{k+s}\left(p_{i}-1\right)\right)=d\left(\prod_{i=1}^{k} p_{i}^{q-2+c_{i}}\right)=\prod_{i=1}^{k}\left(q-1+c_{i}\right) $$  so  $$ \frac{\varphi(d(n))}{d(\varphi(n))}=\frac{q^{k-1}(q-1) 2^{s-1}}{\prod_{i=1}^{k}\left(q-1+c_{i}\right)}=2^{s-1} \cdot \frac{q-1}{q} \cdot \prod_{i=1}^{k} \frac{q}{q-1+c_{i}} $$  which can be made arbitrarily close to $2^{s-1}$ by choosing $q$ large enough. It remains to show that $s$ can be arbitrarily large, i.e. that there can be arbitrarily many primes between $N$ and $2 N$.  This follows, for instance, from the well-known fact that $\sum \frac{1}{p}=\infty$, where the sum is taken over the set $\mathbb{P}$ of prime numbers. Indeed, if, for some constant $\stackrel{p}{C}$, there were always at most $C$ primes between $2^{\ell}$ and $2^{\ell+1}$, we would have  $$ \sum_{p \in \mathbb{P}} \frac{1}{p}=\sum_{\ell=0}^{\infty} \sum_{\substack{p \in \mathbb{P} \\ p \in\left[2^{\ell}, 2^{\ell+1}\right)}} \frac{1}{p} \leqslant \sum_{\ell=0}^{\infty} \frac{C}{2^{\ell}}<\infty, $$  which is a contradiction. Comment 1. Here we sketch several alternative elementary self-contained ways to perform the last step of the solution above. In particular, they avoid using divergence of $\sum \frac{1}{p}$.  Suppose that for some constant $C$ and for every $k=1,2, \ldots$ there exist at most $C$ prime numbers between $2^{k}$ and $2^{k+1}$. Consider the prime factorization of the factorial $\left(2^{n}\right)!=\prod p^{\alpha_{p}}$. We have $\alpha_{p}=\left\lfloor 2^{n} / p\right\rfloor+\left\lfloor 2^{n} / p^{2}\right\rfloor+\ldots$. Thus, for $p \in\left[2^{k}, 2^{k+1}\right)$, we get $\alpha_{p} \leqslant 2^{n} / 2^{k}+2^{n} / 2^{k+1}+\ldots=2^{n-k+1}$, therefore $p^{\alpha_{p}} \leqslant 2^{(k+1) 2^{n-k+1}}$. Combining this with the bound $(2 m)!\geqslant m(m+1) \cdot \ldots \cdot(2 m-1) \geqslant m^{m}$ for $m=2^{n-1}$ we get  $$ 2^{(n-1) \cdot 2^{n-1}} \leqslant\left(2^{n}\right)!\leqslant \prod_{k=1}^{n-1} 2^{C(k+1) 2^{n-k+1}} $$  or  $$ \sum_{k=1}^{n-1} C(k+1) 2^{1-k} \geqslant \frac{n-1}{2} $$  that fails for large $n$ since $C(k+1) 2^{1-k}<1 / 3$ for all but finitely many $k$. In fact, a much stronger inequality can be obtained in an elementary way: Note that the formula for $\nu_{p}(n!)$ implies that if $p^{\alpha}$ is the largest power of $p$ dividing $\binom{n}{n / 2}$, then $p^{\alpha} \leqslant n$. By looking at prime factorization of $\binom{n}{n / 2}$ we instantaneously infer that  $$ \pi(n) \geqslant \log _{n}\binom{n}{n / 2} \geqslant \frac{\log \left(2^{n} / n\right)}{\log n} \geqslant \frac{n}{2 \log n} . $$  This, in particular, implies that for infinitely many $n$ there are at least $\frac{n}{3 \log n}$ primes between $n$ and $2 n$.


Solution: In this solution we will use the Prime Number Theorem which states that  $$ \pi(m)=\frac{m}{\log m} \cdot(1+o(1)) $$  as $m$ tends to infinity. Here and below $\pi(m)$ denotes the number of primes not exceeding $m$, and $\log$ the natural logarithm.  Let $m>5$ be a large positive integer and let $n:=p_{1} p_{2} \cdot \ldots \cdot p_{\pi(m)}$ be the product of all primes not exceeding $m$. Then $\varphi(d(n))=\varphi\left(2^{\pi(m)}\right)=2^{\pi(m)-1}$. Consider the number  $$ \varphi(n)=\prod_{k=1}^{\pi(m)}\left(p_{k}-1\right)=\prod_{s=1}^{\pi(m / 2)} q_{s}^{\alpha_{s}} $$  where $q_{1}, \ldots, q_{\pi(m / 2)}$ are primes not exceeding $m / 2$. Note that every term $p_{k}-1$ contributes at most one prime $q_{s}>\sqrt{m}$ into the product $\prod_{s} q_{s}^{\alpha_{s}}$, so we have  $$ \sum_{s: q_{s}>\sqrt{m}} \alpha_{s} \leqslant \pi(m) \Longrightarrow \sum_{s: q_{s}>\sqrt{m}}\left(1+\alpha_{s}\right) \leqslant \pi(m)+\pi(m / 2) . $$  Hence, applying the AM-GM inequality and the inequality $(A / x)^{x} \leqslant e^{A / e}$, we obtain  $$ \prod_{s: q_{s}>\sqrt{m}}\left(\alpha_{s}+1\right) \leqslant\left(\frac{\pi(m)+\pi(m / 2)}{\ell}\right)^{\ell} \leqslant \exp \left(\frac{\pi(m)+\pi(m / 2)}{e}\right) $$  where $\ell$ is the number of primes in the interval $(\sqrt{m}, m]$. We then use a trivial bound $\alpha_{i} \leqslant \log _{2}(\varphi(n)) \leqslant \log _{2} n<\log _{2}\left(m^{m}\right)<m^{2}$ for each $i$ with $q_{i}<\sqrt{m}$ to obtain  $$ \prod_{s=1}^{\pi(\sqrt{m})}\left(\alpha_{s}+1\right) \leqslant\left(m^{2}\right)^{\sqrt{m}}=m^{2 \sqrt{m}} $$  Putting this together we obtain  $$ d(\varphi(n))=\prod_{s=1}^{\pi(m / 2)}\left(\alpha_{s}+1\right) \leqslant \exp \left(2 \sqrt{m} \cdot \log m+\frac{\pi(m)+\pi(m / 2)}{e}\right) $$  The prime number theorem then implies that  $$ \limsup _{m \rightarrow \infty} \frac{\log (d(\varphi(n)))}{m / \log m} \leqslant \limsup _{m \rightarrow \infty} \frac{2 \sqrt{m} \cdot \log m}{m / \log m}+\limsup _{m \rightarrow \infty} \frac{\pi(m)+\pi(m / 2)}{e \cdot m / \log m}=\frac{3}{2 e} . $$  Whereas, again by prime number theorem, we have  $$ \liminf _{m \rightarrow \infty} \frac{\log (\varphi(d(n)))}{m / \log m}=\liminf _{m \rightarrow \infty} \frac{\log \left(2^{\pi(m)-1}\right)}{m / \log m}=\log 2 $$  Since $\frac{3}{2 e}<\frac{3}{5}<\log 2$, this implies that $\varphi(d(n)) / d(\varphi(n))$ can be arbitrarily large.  Comment 2. The original formulation of the problem was asking whether $d(\varphi(n)) \geqslant \varphi(d(n))$ for all but finitely many values of $n$. The Problem Selection Committee decided that the presented version is better suited for the Shortlist.  This page is intentionally left blank


Let $\mathcal{S}$ be a set consisting of $n \geqslant 3$ positive integers, none of which is a sum of two other distinct members of $\mathcal{S}$. Prove that the elements of $\mathcal{S}$ may be ordered as $a_{1}, a_{2}, \ldots, a_{n}$ so that $a_{i}$ does not divide $a_{i-1}+a_{i+1}$ for all $i=2,3, \ldots, n-1$. (Ukraine) Common remarks. In all solutions, we call a set $\mathcal{S}$ of positive integers good if no its element is a sum of two other distinct members of $\mathcal{S}$. We will use the following simple observation. Observation A. If $a, b$, and $c$ are three distinct elements of a good set $\mathcal{S}$ with $b>a, c$, then $b \nmid a+c$. Otherwise, since $b \neq a+c$, we would have $b \leqslant(a+c) / 2<\max \{a, c\}$.

Solution: We prove the following stronger statement. Claim. Let $\mathcal{S}$ be a good set consisting of $n \geqslant 2$ positive integers. Then the elements of $\mathcal{S}$ may be ordered as $a_{1}, a_{2}, \ldots, a_{n}$ so that $a_{i} \nmid a_{i-1}+a_{i+1}$ and $a_{i} \nmid a_{i-1}-a_{i+1}$, for all $i=2,3, \ldots, n-1$. Proof. Say that the ordering $a_{1}, \ldots, a_{n}$ of $\mathcal{S}$ is nice if it satisfies the required property.  We proceed by induction on $n$. The base case $n=2$ is trivial, as there are no restrictions on the ordering.  To perform the step of induction, suppose that $n \geqslant 3$. Let $a=\max \mathcal{S}$, and set $\mathcal{T}=\mathcal{S} \backslash\{a\}$. Use the inductive hypothesis to find a nice ordering $b_{1}, \ldots, b_{n-1}$ of $\mathcal{T}$. We will show that $a$ may be inserted into this sequence so as to reach a nice ordering of $\mathcal{S}$. In other words, we will show that there exists a $j \in\{1,2, \ldots, n\}$ such that the ordering  $$ N_{j}=\left(b_{1}, \ldots, b_{j-1}, a, b_{j}, b_{j+1}, \ldots, b_{n-1}\right) $$  is nice. Assume that, for some $j$, the ordering $N_{j}$ is not nice, so that some element $x$ in it divides either the sum or the difference of two adjacent ones. This did not happen in the ordering of $\mathcal{T}$, hence $x \in\left\{b_{j-1}, a, b_{j}\right\}$ (if, say, $b_{j-1}$ does not exist, then $x \in\left\{a, b_{j}\right\}$; a similar agreement is applied hereafter). But the case $x=a$ is impossible: $a$ cannot divide $b_{j-1}-b_{j}$, since $0<\left|b_{j-1}-b_{j}\right|<a$, while $a \nmid b_{j-1}+b_{j}$ by Observation A. Therefore $x \in\left\{b_{j-1}, b_{j}\right\}$. In this case, assign the number $x$ to the index $j$.  Suppose now that none of the $N_{j}$ is nice. Since there are $n$ possible indices $j$, and only $n-1$ elements in $\mathcal{T}$, one of those elements (say, $b_{k}$ ) is assigned to two different indices, which then should equal $k$ and $k+1$. This means that $b_{k}$ divides the numbers $b_{k-1}+\varepsilon_{1} a$ and $a+\varepsilon_{2} b_{k+1}$, for some signs $\varepsilon_{1}, \varepsilon_{2} \in\{-1,1\}$. But then  $$ b_{k-1} \equiv-\varepsilon_{1} a \equiv \varepsilon_{1} \varepsilon_{2} b_{k+1} \quad\left(\bmod b_{k}\right), $$  and therefore $b_{k} \mid b_{k-1}-\varepsilon_{1} \varepsilon_{2} b_{k+1}$, which means that the ordering of $\mathcal{T}$ was not nice. This contradiction proves the step of induction.


Solution: We again prove a stronger statement. Claim. Let $\mathcal{S}$ be an arbitrary set of $n \geqslant 3$ positive integers. Then its elements can be ordered as $a_{1}, \ldots, a_{n}$ so that, if $a_{i} \mid a_{i-1}+a_{i+1}$, then $a_{i}=\max \mathcal{S}$.  The claim easily implies what we need to prove, due to Observation A. To prove the Claim, introduce the function $f$ which assigns to any two elements $a, b \in \mathcal{S}$ with $a<b$ the unique integer $f(a, b) \in\{1,2, \ldots, a\}$ such that $a \mid b+f(a, b)$. Hence, if $b \mid a+c$ for some $a, b, c \in \mathcal{S}$ with $a<b<c$, then $a=f(b, c)$. Therefore, the Claim is a consequence of the following combinatorial lemma.  Lemma. Let $\mathcal{S}$ be a set of $n \geqslant 3$ positive integers, and let $f$ be a function which assigns to any $a, b \in \mathcal{S}$ with $a<b$ some integer from the range $\{1, \ldots, a\}$. Then the elements of $\mathcal{S}$ may be ordered as $a_{1}, a_{2}, \ldots, a_{n}$ so as to satisfy the following two conditions simultaneously: (i) Unimodality: There exists a $j \in\{1,2, \ldots, n\}$ such that $a_{1}<a_{2}<\ldots<a_{j}>a_{j+1}>\ldots>$ $a_{n}$; and (ii) $f$-avoidance: If $a<b$ are two elements of $\mathcal{S}$, which are adjacent in the ordering, then $f(a, b)$ is not adjacent to $a$. Proof. We call an ordering of $\mathcal{S}$ satisfying (i) and (ii) $f$-nice. We agree that $f(x, y)=x$ for $x \geqslant y$; this agreement puts no extra restriction.  We proceed by induction; for the base case $n=3$, it suffices to put the maximal element in $\mathcal{S}$ onto the middle position.  To perform the step of induction, let $p<q$ be the two minimal elements of $\mathcal{S}$, and set $\mathcal{T}=\mathcal{S} \backslash\{p\}$. Define a function $g$ by assigning to any elements $a<b$ of $\mathcal{T}$ the value  $$ g(a, b)= \begin{cases}q, & \text { if } f(a, b)=p \\ f(a, b), & \text { otherwise }\end{cases} $$  Notice that $g(a, b) \leqslant a$ for all $a, b \in \mathcal{T}$. Use the inductive hypothesis to get a $g$-nice ordering $b_{1}, b_{2}, \ldots, b_{n-1}$ of $\mathcal{T}$. By unimodality, either $b_{1}$ or $b_{n-1}$ equals $q$; these cases differ only by reverting the order, so we assume $b_{1}=q$.  Notice that, according to (1), the number $f\left(b_{2}, b_{3}\right)$ differs from both $p$ and $q$. On the other hand, the number $f\left(b_{n-1}, b_{n-2}\right)$ differs from at least one of them - say, from $r$; set $s=p+q-r$, so that $\{r, s\}=\{p, q\}$. Now, order $\mathcal{S}$ as  $$ s, b_{2}, b_{3}, \ldots, b_{n-1}, r $$  By the induction hypothesis and the above choice, this ordering is nice. Comment. In the original proposal, the numbers in the set were assumed to be odd (which implies that none is a sum of two others); moreover, the proposal requested to arrange in a row all numbers but one.  On the other hand, Solution 2 shows that the condition of $\mathcal{S}$ being good may be relaxed to the condition that the maximal element of $\mathcal{S}$ is not a sum of two other elements in $\mathcal{S}$. On the other hand, the set $\{1,2,3\}$ shows that the condition cannot be merely omitted.  The Problem Selection Committee considered several versions of the problem and chose the best version in their opinion for the Shortlist.  61st International Mathematical Olympiad Saint Petersburg Russia