Let $a_{1}, a_{2}, \ldots, a_{n}$ be distinct positive integers, $n \geq 3$. Prove that there exist distinct indices $i$ and $j$ such that $a_{i}+a_{j}$ does not divide any of the numbers $3 a_{1}, 3 a_{2}, \ldots, 3 a_{n}$.

Solution: Without loss of generality, let $0<a_{1}<a_{2}<\cdots<a_{n}$. One can also assume that $a_{1}, a_{2}, \ldots, a_{n}$ are coprime. Otherwise division by their greatest common divisor reduces the question to the new sequence whose terms are coprime integers.  Suppose that the claim is false. Then for each $i<n$ there exists a $j$ such that $a_{n}+a_{i}$ divides $3 a_{j}$. If $a_{n}+a_{i}$ is not divisible by 3 then $a_{n}+a_{i}$ divides $a_{j}$ which is impossible as $0<a_{j} \leq a_{n}<a_{n}+a_{i}$. Thus $a_{n}+a_{i}$ is a multiple of 3 for $i=1, \ldots, n-1$, so that $a_{1}, a_{2}, \ldots, a_{n-1}$ are all congruent (to $-a_{n}$ ) modulo 3 .  Now $a_{n}$ is not divisible by 3 or else so would be all remaining $a_{i}$ 's, meaning that $a_{1}, a_{2}, \ldots, a_{n}$ are not coprime. Hence $a_{n} \equiv r(\bmod 3)$ where $r \in\{1,2\}$, and $a_{i} \equiv 3-r(\bmod 3)$ for all $i=1, \ldots, n-1$.  Consider a sum $a_{n-1}+a_{i}$ where $1 \leq i \leq n-2$. There is at least one such sum as $n \geq 3$. Let $j$ be an index such that $a_{n-1}+a_{i}$ divides $3 a_{j}$. Observe that $a_{n-1}+a_{i}$ is not divisible by 3 since $a_{n-1}+a_{i} \equiv 2 a_{i} \not \equiv 0(\bmod 3)$. It follows that $a_{n-1}+a_{i}$ divides $a_{j}$, in particular $a_{n-1}+a_{i} \leq a_{j}$. Hence $a_{n-1}<a_{j} \leq a_{n}$, implying $j=n$. So $a_{n}$ is divisible by all sums $a_{n-1}+a_{i}, 1 \leq i \leq n-2$. In particular $a_{n-1}+a_{i} \leq a_{n}$ for $i=1, \ldots, n-2$.  Let $j$ be such that $a_{n}+a_{n-1}$ divides $3 a_{j}$. If $j \leq n-2$ then $a_{n}+a_{n-1} \leq 3 a_{j}<a_{j}+2 a_{n-1}$. This yields $a_{n}<a_{n-1}+a_{j}$; however $a_{n-1}+a_{j} \leq a_{n}$ for $j \leq n-2$. Therefore $j=n-1$ or $j=n$.  For $j=n-1$ we obtain $3 a_{n-1}=k\left(a_{n}+a_{n-1}\right)$ with $k$ an integer, and it is straightforward that $k=1\left(k \leq 0\right.$ and $k \geq 3$ contradict $0<a_{n-1}<a_{n} ; k=2$ leads to $\left.a_{n-1}=2 a_{n}>a_{n-1}\right)$. Thus $3 a_{n-1}=a_{n}+a_{n-1}$, i. e. $a_{n}=2 a_{n-1}$.  Similarly, if $j=n$ then $3 a_{n}=k\left(a_{n}+a_{n-1}\right)$ for some integer $k$, and only $k=2$ is possible. Hence $a_{n}=2 a_{n-1}$ holds true in both cases remaining, $j=n-1$ and $j=n$.  Now $a_{n}=2 a_{n-1}$ implies that the sum $a_{n-1}+a_{1}$ is strictly between $a_{n} / 2$ and $a_{n}$. But $a_{n-1}$ and $a_{1}$ are distinct as $n \geq 3$, so it follows from the above that $a_{n-1}+a_{1}$ divides $a_{n}$. This provides the desired contradiction.


Let $a_{0}, a_{1}, a_{2}, \ldots$ be a sequence of positive integers such that the greatest common divisor of any two consecutive terms is greater than the preceding term; in symbols, $\operatorname{gcd}\left(a_{i}, a_{i+1}\right)>a_{i-1}$. Prove that $a_{n} \geq 2^{n}$ for all $n \geq 0$.

Solution: Since $a_{i} \geq \operatorname{gcd}\left(a_{i}, a_{i+1}\right)>a_{i-1}$, the sequence is strictly increasing. In particular $a_{0} \geq 1, a_{1} \geq 2$. For each $i \geq 1$ we also have $a_{i+1}-a_{i} \geq \operatorname{gcd}\left(a_{i}, a_{i+1}\right)>a_{i-1}$, and consequently $a_{i+1} \geq a_{i}+a_{i-1}+1$. Hence $a_{2} \geq 4$ and $a_{3} \geq 7$. The equality $a_{3}=7$ would force equalities in the previous estimates, leading to $\operatorname{gcd}\left(a_{2}, a_{3}\right)=\operatorname{gcd}(4,7)>a_{1}=2$, which is false. Thus $a_{3} \geq 8$; the result is valid for $n=0,1,2,3$. These are the base cases for a proof by induction.  Take an $n \geq 3$ and assume that $a_{i} \geq 2^{i}$ for $i=0,1, \ldots, n$. We must show that $a_{n+1} \geq 2^{n+1}$. Let $\operatorname{gcd}\left(a_{n}, a_{n+1}\right)=d$. We know that $d>a_{n-1}$. The induction claim is reached immediately in the following cases:  $$ \begin{array}{ll} \text { if } \quad a_{n+1} \geq 4 d & \text { then } a_{n+1}>4 a_{n-1} \geq 4 \cdot 2^{n-1}=2^{n+1} \\ \text { if } \quad a_{n} \geq 3 d & \text { then } a_{n+1} \geq a_{n}+d \geq 4 d>4 a_{n-1} \geq 4 \cdot 2^{n-1}=2^{n+1} \\ \text { if } \quad a_{n}=d & \text { then } a_{n+1} \geq a_{n}+d=2 a_{n} \geq 2 \cdot 2^{n}=2^{n+1} \end{array} $$  The only remaining possibility is that $a_{n}=2 d$ and $a_{n+1}=3 d$, which we assume for the sequel. So $a_{n+1}=\frac{3}{2} a_{n}$.  Let now $\operatorname{gcd}\left(a_{n-1}, a_{n}\right)=d^{\prime}$; then $d^{\prime}>a_{n-2}$. Write $a_{n}=m d^{\prime} \quad(m$ an integer $)$. Keeping in mind that $d^{\prime} \leq a_{n-1}<d$ and $a_{n}=2 d$, we get that $m \geq 3$. Also $a_{n-1}<d=\frac{1}{2} m d^{\prime}$, $a_{n+1}=\frac{3}{2} m d^{\prime}$. Again we single out the cases which imply the induction claim immediately:  $$ \begin{aligned} & \text { if } m \geq 6 \quad \text { then } a_{n+1}=\frac{3}{2} m d^{\prime} \geq 9 d^{\prime}>9 a_{n-2} \geq 9 \cdot 2^{n-2}>2^{n+1} \\ & \text { if } 3 \leq m \leq 4 \text { then } a_{n-1}<\frac{1}{2} \cdot 4 d^{\prime} \text {, and hence } a_{n-1}=d^{\prime} \\ & \qquad a_{n+1}=\frac{3}{2} m a_{n-1} \geq \frac{3}{2} \cdot 3 a_{n-1} \geq \frac{9}{2} \cdot 2^{n-1}>2^{n+1} . \end{aligned} $$  So we are left with the case $m=5$, which means that $a_{n}=5 d^{\prime}, a_{n+1}=\frac{15}{2} d^{\prime}, a_{n-1}<d=\frac{5}{2} d^{\prime}$. The last relation implies that $a_{n-1}$ is either $d^{\prime}$ or $2 d^{\prime}$. Anyway, $a_{n-1} \mid 2 d^{\prime}$.  The same pattern repeats once more. We denote $\operatorname{gcd}\left(a_{n-2}, a_{n-1}\right)=d^{\prime \prime}$; then $d^{\prime \prime}>a_{n-3}$. Because $d^{\prime \prime}$ is a divisor of $a_{n-1}$, hence also of $2 d^{\prime}$, we may write $2 d^{\prime}=m^{\prime} d^{\prime \prime}$ ( $m^{\prime}$ an integer). Since $d^{\prime \prime} \leq a_{n-2}<d^{\prime}$, we get $m^{\prime} \geq 3$. Also, $a_{n-2}<d^{\prime}=\frac{1}{2} m^{\prime} d^{\prime \prime}, a_{n+1}=\frac{15}{2} d^{\prime}=\frac{15}{4} m^{\prime} d^{\prime \prime}$. As before, we consider the cases:  $$ \begin{aligned} & \text { if } m^{\prime} \geq 5 \quad \text { then } a_{n+1}=\frac{15}{4} m^{\prime} d^{\prime \prime} \geq \frac{75}{4} d^{\prime \prime}>\frac{75}{4} a_{n-3} \geq \frac{75}{4} \cdot 2^{n-3}>2^{n+1} \\ & \text { if } 3 \leq m^{\prime} \leq 4 \text { then } a_{n-2}<\frac{1}{2} \cdot 4 d^{\prime \prime} \text {, and hence } a_{n-2}=d^{\prime \prime} \\ & \qquad a_{n+1}=\frac{15}{4} m^{\prime} a_{n-2} \geq \frac{15}{4} \cdot 3 a_{n-2} \geq \frac{45}{4} \cdot 2^{n-2}>2^{n+1} . \end{aligned} $$  Both of them have produced the induction claim. But now there are no cases left. Induction is complete; the inequality $a_{n} \geq 2^{n}$ holds for all $n$.


Let $n$ be a positive integer. Show that the numbers  $$ \left(\begin{array}{c} 2^{n}-1 \\ 0 \end{array}\right), \quad\left(\begin{array}{c} 2^{n}-1 \\ 1 \end{array}\right), \quad\left(\begin{array}{c} 2^{n}-1 \\ 2 \end{array}\right), \quad \ldots, \quad\left(\begin{array}{c} 2^{n}-1 \\ 2^{n-1}-1 \end{array}\right) $$  are congruent modulo $2^{n}$ to $1,3,5, \ldots, 2^{n}-1$ in some order.

Solution: It is well-known that all these numbers are odd. So the assertion that their remainders $\left(\bmod 2^{n}\right)$ make up a permutation of $\left\{1,3, \ldots, 2^{n}-1\right\}$ is equivalent just to saying that these remainders are all distinct. We begin by showing that  $$ \left(\begin{array}{c} 2^{n}-1 \\ 2 k \end{array}\right)+\left(\begin{array}{c} 2^{n}-1 \\ 2 k+1 \end{array}\right) \equiv 0 \quad\left(\bmod 2^{n}\right) \quad \text { and } \quad\left(\begin{array}{c} 2^{n}-1 \\ 2 k \end{array}\right) \equiv(-1)^{k}\left(\begin{array}{c} 2^{n-1}-1 \\ k \end{array}\right) \quad\left(\bmod 2^{n}\right) $$  The first relation is immediate, as the sum on the left is equal to $\left(\begin{array}{c}2^{n} \\ 2 k+1\end{array}\right)=\frac{2^{n}}{2 k+1}\left(\begin{array}{c}2^{n}-1 \\ 2 k\end{array}\right)$, hence is divisible by $2^{n}$. The second relation:  $$ \left(\begin{array}{c} 2^{n}-1 \\ 2 k \end{array}\right)=\prod_{j=1}^{2 k} \frac{2^{n}-j}{j}=\prod_{i=1}^{k} \frac{2^{n}-(2 i-1)}{2 i-1} \cdot \prod_{i=1}^{k} \frac{2^{n-1}-i}{i} \equiv(-1)^{k}\left(\begin{array}{c} 2^{n-1}-1 \\ k \end{array}\right) \quad\left(\bmod 2^{n}\right) . $$  This prepares ground for a proof of the required result by induction on $n$. The base case $n=1$ is obvious. Assume the assertion is true for $n-1$ and pass to $n$, denoting $a_{k}=\left(\begin{array}{c}2^{n-1}-1 \\ k\end{array}\right)$, $b_{m}=\left(\begin{array}{c}2^{n}-1 \\ m\end{array}\right)$. The induction hypothesis is that all the numbers $a_{k}\left(0 \leq k<2^{n-2}\right)$ are distinct $\left(\bmod 2^{n-1}\right)$; the claim is that all the numbers $b_{m}\left(0 \leq m<2^{n-1}\right)$ are distinct $\left(\bmod 2^{n}\right)$.  The congruence relations (1) are restated as  $$ b_{2 k} \equiv(-1)^{k} a_{k} \equiv-b_{2 k+1} \quad\left(\bmod 2^{n}\right) $$  Shifting the exponent in the first relation of (1) from $n$ to $n-1$ we also have the congruence $a_{2 i+1} \equiv-a_{2 i}\left(\bmod 2^{n-1}\right)$. We hence conclude:  If, for some $j, k<2^{n-2}, a_{k} \equiv-a_{j}\left(\bmod 2^{n-1}\right)$, then $\{j, k\}=\{2 i, 2 i+1\}$ for some $i$.  This is so because in the sequence $\left(a_{k}: k<2^{n-2}\right)$ each term $a_{j}$ is complemented to $0\left(\bmod 2^{n-1}\right)$ by only one other term $a_{k}$, according to the induction hypothesis.  From (2) we see that $b_{4 i} \equiv a_{2 i}$ and $b_{4 i+3} \equiv a_{2 i+1}\left(\bmod 2^{n}\right)$. Let  $$ M=\left\{m: 0 \leq m<2^{n-1}, m \equiv 0 \text { or } 3(\bmod 4)\right\}, \quad L=\left\{l: 0 \leq l<2^{n-1}, l \equiv 1 \text { or } 2(\bmod 4)\right\} $$  The last two congruences take on the unified form  $$ b_{m} \equiv a_{\lfloor m / 2\rfloor} \quad\left(\bmod 2^{n}\right) \quad \text { for all } \quad m \in M $$  Thus all the numbers $b_{m}$ for $m \in M$ are distinct $\left(\bmod 2^{n}\right)$ because so are the numbers $a_{k}$ (they are distinct $\left(\bmod 2^{n-1}\right)$, hence also $\left(\bmod 2^{n}\right)$ ).  Every $l \in L$ is paired with a unique $m \in M$ into a pair of the form $\{2 k, 2 k+1\}$. So (2) implies that also all the $b_{l}$ for $l \in L$ are distinct $\left(\bmod 2^{n}\right)$. It remains to eliminate the possibility that $b_{m} \equiv b_{l}\left(\bmod 2^{n}\right)$ for some $m \in M, l \in L$.  Suppose that such a situation occurs. Let $m^{\prime} \in M$ be such that $\left\{m^{\prime}, l\right\}$ is a pair of the form $\{2 k, 2 k+1\}$, so that $($ see $(2)) b_{m^{\prime}} \equiv-b_{l}\left(\bmod 2^{n}\right)$. Hence $b_{m^{\prime}} \equiv-b_{m}\left(\bmod 2^{n}\right)$. Since both $m^{\prime}$ and $m$ are in $M$, we have by (4) $b_{m^{\prime}} \equiv a_{j}, b_{m} \equiv a_{k}\left(\bmod 2^{n}\right)$ for $j=\left\lfloor m^{\prime} / 2\right\rfloor, k=\lfloor m / 2\rfloor$.  Then $a_{j} \equiv-a_{k}\left(\bmod 2^{n}\right)$. Thus, according to $(3), j=2 i, k=2 i+1$ for some $i$ (or vice versa). The equality $a_{2 i+1} \equiv-a_{2 i}\left(\bmod 2^{n}\right)$ now means that $\left(\begin{array}{c}2^{n-1}-1 \\ 2 i\end{array}\right)+\left(\begin{array}{c}2^{n-1}-1 \\ 2 i+1\end{array}\right) \equiv 0\left(\bmod 2^{n}\right)$. However, the sum on the left is equal to $\left(\begin{array}{c}2^{n-1} \\ 2 i+1\end{array}\right)$. A number of this form cannot be divisible by $2^{n}$. This is a contradiction which concludes the induction step and proves the result.


Solution: We again proceed by induction, writing for brevity $N=2^{n-1}$ and keeping notation $a_{k}=\left(\begin{array}{c}N-1 \\ k\end{array}\right), b_{m}=\left(\begin{array}{c}2 N-1 \\ m\end{array}\right)$. Assume that the result holds for the sequence $\left(a_{0}, a_{1}, a_{2}, \ldots, a_{N / 2-1}\right)$. In view of the symmetry $a_{N-1-k}=a_{k}$ this sequence is a permutation of $\left(a_{0}, a_{2}, a_{4}, \ldots, a_{N-2}\right)$. So the induction hypothesis says that this latter sequence, taken $(\bmod N)$, is a permutation of $(1,3,5, \ldots, N-1)$. Similarly, the induction claim is that $\left(b_{0}, b_{2}, b_{4}, \ldots, b_{2 N-2}\right)$, taken $(\bmod 2 N)$, is a permutation of $(1,3,5, \ldots, 2 N-1)$.  In place of the congruence relations (2) we now use the following ones,  $$ b_{4 i} \equiv a_{2 i} \quad(\bmod N) \quad \text { and } \quad b_{4 i+2} \equiv b_{4 i}+N \quad(\bmod 2 N) . $$  Given this, the conclusion is immediate: the first formula of (5) together with the induction hypothesis tells us that $\left(b_{0}, b_{4}, b_{8}, \ldots, b_{2 N-4}\right)(\bmod N)$ is a permutation of $(1,3,5, \ldots, N-1)$. Then the second formula of $(5)$ shows that $\left(b_{2}, b_{6}, b_{10}, \ldots, b_{2 N-2}\right)(\bmod N)$ is exactly the same permutation; moreover, this formula distinguishes $(\bmod 2 N)$ each $b_{4 i}$ from $b_{4 i+2}$.  Consequently, these two sequences combined represent $(\bmod 2 N)$ a permutation of the sequence $(1,3,5, \ldots, N-1, N+1, N+3, N+5, \ldots, N+N-1)$, and this is precisely the induction claim.  Now we prove formulas (5); we begin with the second one. Since $b_{m+1}=b_{m} \cdot \frac{2 N-m-1}{m+1}$,  $$ b_{4 i+2}=b_{4 i} \cdot \frac{2 N-4 i-1}{4 i+1} \cdot \frac{2 N-4 i-2}{4 i+2}=b_{4 i} \cdot \frac{2 N-4 i-1}{4 i+1} \cdot \frac{N-2 i-1}{2 i+1} . $$  The desired congruence $b_{4 i+2} \equiv b_{4 i}+N$ may be multiplied by the odd number $(4 i+1)(2 i+1)$, giving rise to a chain of successively equivalent congruences:  $$ \begin{aligned} b_{4 i}(2 N-4 i-1)(N-2 i-1) & \equiv\left(b_{4 i}+N\right)(4 i+1)(2 i+1) & & (\bmod 2 N), \\ b_{4 i}(2 i+1-N) & \equiv\left(b_{4 i}+N\right)(2 i+1) & & (\bmod 2 N), \\ \left(b_{4 i}+2 i+1\right) N & \equiv 0 & & (\bmod 2 N) ; \end{aligned} $$  and the last one is satisfied, as $b_{4 i}$ is odd. This settles the second relation in (5).  The first one is proved by induction on $i$. It holds for $i=0$. Assume $b_{4 i} \equiv a_{2 i}(\bmod 2 N)$ and consider $i+1$ :  $$ b_{4 i+4}=b_{4 i+2} \cdot \frac{2 N-4 i-3}{4 i+3} \cdot \frac{2 N-4 i-4}{4 i+4} ; \quad a_{2 i+2}=a_{2 i} \cdot \frac{N-2 i-1}{2 i+1} \cdot \frac{N-2 i-2}{2 i+2} . $$  Both expressions have the fraction $\frac{N-2 i-2}{2 i+2}$ as the last factor. Since $2 i+2<N=2^{n-1}$, this fraction reduces to $\ell / m$ with $\ell$ and $m$ odd. In showing that $b_{4 i+4} \equiv a_{2 i+2}(\bmod 2 N)$, we may ignore this common factor $\ell / m$. Clearing other odd denominators reduces the claim to  $$ b_{4 i+2}(2 N-4 i-3)(2 i+1) \equiv a_{2 i}(N-2 i-1)(4 i+3) \quad(\bmod 2 N) $$  By the inductive assumption (saying that $b_{4 i} \equiv a_{2 i}(\bmod 2 N)$ ) and by the second relation of (5), this is equivalent to  $$ \left(b_{4 i}+N\right)(2 i+1) \equiv b_{4 i}(2 i+1-N) \quad(\bmod 2 N) $$  a congruence which we have already met in the preceding proof a few lines above. This completes induction (on $i$ ) and the proof of (5), hence also the whole solution.  Comment. One can avoid the words congruent modulo in the problem statement by rephrasing the assertion into: Show that these numbers leave distinct remainders in division by $2^{n}$.


For every $n \in \mathbb{N}$ let $d(n)$ denote the number of (positive) divisors of $n$. Find all functions $f: \mathbb{N} \rightarrow \mathbb{N}$ with the following properties:  (i) $d(f(x))=x$ for all $x \in \mathbb{N}$;  (ii) $f(x y)$ divides $(x-1) y^{x y-1} f(x)$ for all $x, y \in \mathbb{N}$.

Solution: There is a unique solution: the function $f: \mathbb{N} \rightarrow \mathbb{N}$ defined by $f(1)=1$ and $f(n)=p_{1}^{p_{1}^{a_{1}}-1} p_{2}^{p_{2}^{a_{2}}-1} \cdots p_{k}^{p_{k}^{a_{k}}-1}$ where $n=p_{1}^{a_{1}} p_{2}^{a_{2}} \cdots p_{k}^{a_{k}}$ is the prime factorization of $n>1$.  Direct verification shows that this function meets the requirements.  Conversely, let $f: \mathbb{N} \rightarrow \mathbb{N}$ satisfy (i) and (ii). Applying (i) for $x=1$ gives $d(f(1))=1$, so $f(1)=1$. In the sequel we prove that (1) holds for all $n>1$. Notice that $f(m)=f(n)$ implies $m=n$ in view of (i). The formula $d\left(p_{1}^{b_{1}} \cdots p_{k}^{b_{k}}\right)=\left(b_{1}+1\right) \cdots\left(b_{k}+1\right)$ will be used throughout.  Let $p$ be a prime. Since $d(f(p))=p$, the formula just mentioned yields $f(p)=q^{p-1}$ for some prime $q$; in particular $f(2)=q^{2-1}=q$ is a prime. We prove that $f(p)=p^{p-1}$ for all primes $p$.  Suppose that $p$ is odd and $f(p)=q^{p-1}$ for a prime $q$. Applying (ii) first with $x=2$, $y=p$ and then with $x=p, y=2$ shows that $f(2 p)$ divides both $(2-1) p^{2 p-1} f(2)=p^{2 p-1} f(2)$ and $(p-1) 2^{2 p-1} f(p)=(p-1) 2^{2 p-1} q^{p-1}$. If $q \neq p$ then the odd prime $p$ does not divide $(p-1) 2^{2 p-1} q^{p-1}$, hence the greatest common divisor of $p^{2 p-1} f(2)$ and $(p-1) 2^{2 p-1} q^{p-1}$ is a divisor of $f(2)$. Thus $f(2 p)$ divides $f(2)$ which is a prime. As $f(2 p)>1$, we obtain $f(2 p)=f(2)$ which is impossible. So $q=p$, i. e. $f(p)=p^{p-1}$.  For $p=2$ the same argument with $x=2, y=3$ and $x=3, y=2$ shows that $f(6)$ divides both $3^{5} f(2)$ and $2^{6} f(3)=2^{6} 3^{2}$. If the prime $f(2)$ is odd then $f(6)$ divides $3^{2}=9$, so $f(6) \in\{1,3,9\}$. However then $6=d(f(6)) \in\{d(1), d(3), d(9)\}=\{1,2,3\}$ which is false. In conclusion $f(2)=2$.  Next, for each $n>1$ the prime divisors of $f(n)$ are among the ones of $n$. Indeed, let $p$ be the least prime divisor of $n$. Apply (ii) with $x=p$ and $y=n / p$ to obtain that $f(n)$ divides $(p-1) y^{n-1} f(p)=(p-1) y^{n-1} p^{p-1}$. Write $f(n)=\ell P$ where $\ell$ is coprime to $n$ and $P$ is a product of primes dividing $n$. Since $\ell$ divides $(p-1) y^{n-1} p^{p-1}$ and is coprime to $y^{n-1} p^{p-1}$, it divides $p-1$; hence $d(\ell) \leq \ell<p$. But (i) gives $n=d(f(n))=d(\ell P)$, and $d(\ell P)=d(\ell) d(P)$ as $\ell$ and $P$ are coprime. Therefore $d(\ell)$ is a divisor of $n$ less than $p$, meaning that $\ell=1$ and proving the claim.  Now (1) is immediate for prime powers. If $p$ is a prime and $a \geq 1$, by the above the only prime factor of $f\left(p^{a}\right)$ is $p$ (a prime factor does exist as $f\left(p^{a}\right)>1$ ). So $f\left(p^{a}\right)=p^{b}$ for some $b \geq 1$, and (i) yields $p^{a}=d\left(f\left(p^{a}\right)\right)=d\left(p^{b}\right)=b+1$. Hence $f\left(p^{a}\right)=p^{p^{a}-1}$, as needed.  Let us finally show that (1) is true for a general $n>1$ with prime factorization $n=p_{1}^{a_{1}} \cdots p_{k}^{a_{k}}$. We saw that the prime factorization of $f(n)$ has the form $f(n)=p_{1}^{b_{1}} \cdots p_{k}^{b_{k}}$. For $i=1, \ldots, k$, set $x=p_{i}^{a_{i}}$ and $y=n / x$ in (ii) to infer that $f(n)$ divides $\left(p_{i}^{a_{i}}-1\right) y^{n-1} f\left(p_{i}^{a_{i}}\right)$. Hence $p_{i}^{b_{i}}$ divides $\left(p_{i}^{a_{i}}-1\right) y^{n-1} f\left(p_{i}^{a_{i}}\right)$, and because $p_{i}^{b_{i}}$ is coprime to $\left(p_{i}^{a_{i}}-1\right) y^{n-1}$, it follows that $p_{i}^{b_{i}}$ divides $f\left(p_{i}^{a_{i}}\right)=p_{i}^{p_{i}^{a_{i}}-1}$. So $b_{i} \leq p_{i}^{a_{i}}-1$ for all $i=1, \ldots, k$. Combined with (i), these conclusions imply  $$ p_{1}^{a_{1}} \cdots p_{k}^{a_{k}}=n=d(f(n))=d\left(p_{1}^{b_{1}} \cdots p_{k}^{b_{k}}\right)=\left(b_{1}+1\right) \cdots\left(b_{k}+1\right) \leq p_{1}^{a_{1}} \cdots p_{k}^{a_{k}} . $$  Hence all inequalities $b_{i} \leq p_{i}^{a_{i}}-1$ must be equalities, $i=1, \ldots, k$, implying that (1) holds true. The proof is complete.


Prove that there exist infinitely many positive integers $n$ such that $n^{2}+1$ has a prime divisor greater than $2 n+\sqrt{2 n}$.

Solution: Let $p \equiv 1(\bmod 8)$ be a prime. The congruence $x^{2} \equiv-1(\bmod p)$ has two solutions in $[1, p-1]$ whose sum is $p$. If $n$ is the smaller one of them then $p$ divides $n^{2}+1$ and $n \leq(p-1) / 2$. We show that $p>2 n+\sqrt{10 n}$.  Let $n=(p-1) / 2-\ell$ where $\ell \geq 0$. Then $n^{2} \equiv-1(\bmod p)$ gives  $$ \left(\frac{p-1}{2}-\ell\right)^{2} \equiv-1 \quad(\bmod p) \quad \text { or } \quad(2 \ell+1)^{2}+4 \equiv 0 \quad(\bmod p) $$  Thus $(2 \ell+1)^{2}+4=r p$ for some $r \geq 0$. As $(2 \ell+1)^{2} \equiv 1 \equiv p(\bmod 8)$, we have $r \equiv 5(\bmod 8)$, so that $r \geq 5$. Hence $(2 \ell+1)^{2}+4 \geq 5 p$, implying $\ell \geq(\sqrt{5 p-4}-1) / 2$. Set $\sqrt{5 p-4}=u$ for clarity; then $\ell \geq(u-1) / 2$. Therefore  $$ n=\frac{p-1}{2}-\ell \leq \frac{1}{2}(p-u) $$  Combined with $p=\left(u^{2}+4\right) / 5$, this leads to $u^{2}-5 u-10 n+4 \geq 0$. Solving this quadratic inequality with respect to $u \geq 0$ gives $u \geq(5+\sqrt{40 n+9}) / 2$. So the estimate $n \leq(p-u) / 2$ leads to  $$ p \geq 2 n+u \geq 2 n+\frac{1}{2}(5+\sqrt{40 n+9})>2 n+\sqrt{10 n} $$  Since there are infinitely many primes of the form $8 k+1$, it follows easily that there are also infinitely many $n$ with the stated property.  Comment. By considering the prime factorization of the product $\prod_{n=1}^{N}\left(n^{2}+1\right)$, it can be obtained that its greatest prime divisor is at least $c N \log N$. This could improve the statement as $p>n \log n$.  However, the proof applies some advanced information about the distribution of the primes of the form $4 k+1$, which is inappropriate for high schools contests.