2. Determine all functions $f: \mathbb{N} \rightarrow \mathbb{N}$ such that for every natural number $n$ the following conditions hold:

(i) $\sum_{k=1}^{n} f(k)$ is a square of a natural number and

(ii) $n^{3}$ is divisible by $f(n)$.

(Albania)
2. The function $f(x)=x^{3}$ satisfies the conditions - let's recall the formula $\sum_{k=1}^{n} k^{3}=\left(\frac{n(n+1)}{2}\right)^{2}$. We will prove by induction that it must be $f(n)=n^{3}$ for every $n$. Clearly, $f(1)=1$; assume that $f(x)=x$ for $x=1,2, \ldots, n-1(n \geqslant 2)$. By condition (i),

$$
f(1)+\cdots+f(n-1)+f(n)=\left(\frac{n(n-1)}{2}\right)^{2}+f(n)=\left(\frac{n(n-1)}{2}+k\right)^{2}
$$

for some $k \in \mathbb{N}$, so $f(n)=k\left(n^{2}-n+k\right)$. At the same time, $k \leqslant n$ (otherwise it would be $f(n)>n^{3}$). Due to (ii), it also holds that $\left(n^{2}-n+k\right) \mid n^{3}$. On the other hand, $n \leqslant \frac{n^{3}}{n^{2}-n+k} \leqslant \frac{n^{3}}{n^{2}-n+1}0$. Since the sequence $\left(x_{n}\right)$ is strictly increasing, $x_{n} \geqslant n$. On the other hand,

$$
x_{n}^{2} \leqslant \sum_{i=1}^{n} i^{3}=\left(\frac{n(n+1)}{2}\right)^{2} \quad \Rightarrow \quad x_{n} \leqslant \frac{n(n+1)}{2}
$$

Let $n=p$ be a prime number. From the previous, $p<x_{p}+x_{p-1} \leqslant \frac{p(p+1)}{2}+\frac{p(p-1)}{2}=p^{2}$. On the other hand, $x_{p}+x_{p-1}\left|x_{p}^{2}-x_{p-1}^{2}=f(p)\right| p^{3}$, so the only possibility is $f(p)=p^{2}$ and therefore $x_{p}=\frac{p(p+1)}{2}$ and $x_{p-1}=\frac{p(p-1)}{2}$. Then all inequalities in (*) must be equalities, so $f(i)=i^{3}$ for all $i \leqslant p$. This holds for every $p$, so $f(x) \equiv x^{3}$. From (*) it also follows that this function satisfies the conditions of the problem.