## Task 4.

Determine all natural numbers $n$ for which there exists a permutation $\left(d_{1}, d_{2}, \ldots, d_{k}\right)$ of the set of all positive divisors of $n$ such that, for every $i \in\{1,2, \ldots, k\}$, the number

$$
d_{1}+d_{2}+\ldots+d_{i}
$$

is a square of a natural number.
## First Solution.

Assume that a natural number $n$ satisfies the condition of the problem. We prove by mathematical induction that for every $i \in\{1, \ldots, k\}$, $d_{i}=2 i-1$.

If $d_{1} \neq 1$, then there exists $11$, then $2 i-2+u$ is a divisor of $d_{i}$, and thus a divisor of $n$, which is greater than $d_{1}, \ldots, d_{i-1}$ and smaller than $d_{i}$, so it appears later in the sequence. However, then $2 i-2+u$ is the difference of two squares greater than or equal to $i-1+u$, so it is greater than or equal to $(i+u)^{2}-(i-1+u)^{2}=2 i-1+u$, which is a contradiction. Therefore, $u=1$ and $d_{i}=2 i-1$, completing the induction step.

We conclude that the set of divisors of $n$ is $\{1,3, \ldots, 2 k-1\}$. In particular, $2 k-3$ is a divisor of $2 k-1$, which is impossible for $k>2$ since then $1<\frac{2 k-1}{2 k-3}<2$. Therefore, $k \leqslant 2$, and $n \in\{1,3\}$.

It is easy to verify that 1 and 3 satisfy the conditions of the problem, with the corresponding permutations (1) and (1,3).