2. Find all positive integers $n$ for which the numbers $1,2, \ldots, n$ can be divided into three non-empty disjoint sets with different numbers of elements such that in any pair of sets, the set with the smaller number of elements has a greater sum of its elements. (If a set has one element, we consider it as the sum of all its elements.)

将上面的文本翻译成英文，请保留源文本的换行和格式，直接输出翻译结果。 

Note: The last sentence is a repetition of the instruction and should not be included in the final translation. Here is the corrected version:

2. Find all positive integers $n$ for which the numbers $1,2, \ldots, n$ can be divided into three non-empty disjoint sets with different numbers of elements such that in any pair of sets, the set with the smaller number of elements has a greater sum of its elements. (If a set has one element, we consider it as the sum of all its elements.)
2. Small numbers $n$ can be excluded step by step with the following considerations.

The three created sets must have different numbers of elements, which is only possible for $n \geq 1+2+3=6$.

For $n=6$, the smallest set will contain only one element, so the sum of its elements will be at most 6. Meanwhile, the sum of the five numbers outside this set is at least 15, so the sum of the elements of one of the remaining two sets is at least 8, which is greater than the number in the single-element set, contradicting the requirement of the problem. A similar argument excludes the numbers $n=7$ and $n=8$, for which one number must also form an entire set.

For $n=9$, a suitable partition is, for example, $\{9,8\},\{7,6,3\},\{5,4,2,1\}$.

For $n=10$, the smallest set must contain two elements, whose sum is at most 19. Meanwhile, the sum of the other numbers is 36, and since the sums of the elements of the remaining two sets are not the same, one of them must be at least 19, which leads to a contradiction. Similarly, we derive a contradiction for $n=11$.

Now we describe a suitable partition for each number $n \geqq 12$, which can be written in the form $n=3 k+r$, where $k \geqq 4$ and $r \in\{0,1,2\}$. The number of elements in the three sets will be in increasing order $k-1, k$, and $k+r+1$. We place $k-1$ largest numbers from $\{1,2, \ldots, n\}$ (i.e., the numbers from $n-k+2$ to $n$ inclusive) into the first set $\mathrm{M}_{1}$, the second set $\mathrm{M}_{2}$ will consist of the next $k$ largest numbers (i.e., the numbers from $n-2 k+2$ to $n-k+1$), and the remaining $k+r+1$ smallest numbers will form the set $\mathrm{M}_{3}$.

Since all numbers in $\mathrm{M}_{1}$ are greater than all numbers in $\mathrm{M}_{2}$, which has only one element fewer than $\mathrm{M}_{1}$, it suffices to show that the sum of the three largest numbers in $\mathrm{M}_{1}$ is greater than the sum of the four smallest numbers in $\mathrm{M}_{2}$, and it will be clear that this inequality holds for the sums of all numbers in $\mathrm{M}_{1}$ and $\mathrm{M}_{2}$. The mentioned three and four numbers indeed exist (since $k \geqq 4$) and the required inequality $n+(n-1)+(n-2)>(n-2 k+2)+(n-2 k+3)+(n-2 k+4)+(n-2 k+5)$ is equivalent to the inequality $8 k-n>17$, which, after substituting $n=3 k+r$, becomes the inequality $5 k>17+r$. This holds because $5 k \geqq 20$ and $17+r \leqq 19$. Similarly, we explain that the set $\mathrm{M}_{2}$ has a greater sum of elements than the set $\mathrm{M}_{3}$, which has $r+1$ more elements than $\mathrm{M}_{2}$: the two largest numbers in $\mathrm{M}_{2}$ certainly have a sum greater than the $r+3$ smallest numbers in $\mathrm{M}_{3}$, because $(n-k+1)+(n-k)=2(3 k+r-k)+1=4 k+2 r+1 \geqq 17>15=1+2+3+4+5$.

The problem is satisfied by all integers $n \geq 12$ and $n=9$.

Another solution. We will show how to exclude small non-satisfying numbers $n$ with a more general argument. Suppose, therefore, that for some positive integer $n$ the required partition exists. Let the individual sets be $M_{1}, M_{2}$, and $M_{3}$ in order of their increasing cardinality. If we denote by $p$ the number of elements in the set $M_{1}$, which has the largest sum of elements, we have $p+(p+1)+(p+2) \leqq n$, i.e.,

$$
p \leqq \frac{n}{3}-1
$$

Another important inequality is obtained by observing that the sum $s_{1}$ of the elements in $\mathrm{M}_{1}$ is at most $n+(n-1)+\ldots+(n-p+1)=\frac{1}{2} p(2 n-p+1)$ and must be greater than the sums of the elements $s_{2}$ and $s_{3}$ in the remaining two sets. With regard to the integrality of these three sums, we get

$$
1+2+\ldots+n=s_{1}+s_{2}+s_{3} \leqq s_{1}+\left(s_{1}-1\right)+\left(s_{1}-2\right)=3 s_{1}-3
$$

thus $\frac{1}{6} n(n+1)+1 \leqq s_{1}$. By comparing both estimates for $s_{1}$, we get the inequality

$$
\frac{1}{6} n(n+1)+1 \leqq \frac{1}{2} p(2 n-p+1)
$$

or

$$
n^{2}+n(1-6 p)+3 p^{2}-3 p+6 \leqq 0 .
$$

If $p=1$, then by (1) $n \geqq 6$ and (2) reduces to the inequality $n^{2}-5 n+6 \leqq 0$, which does not hold for any $n \geqq 6$.

If $p=2$, then by (1) $n \geqq 9$ and (2) reduces to the inequality $n^{2}-11 n+12 \leqq 0$, which does not hold for any $n \geqq 10$. The case $p=2$ is therefore possible only for $n=9$, which indeed satisfies (see the original solution). For further satisfying $n$, therefore, $p \geqq 3$, i.e., by (1) $n \geqq 12$.

Now we will show in another way that the sets $M_{1}, M_{2}, M_{3}$ constructed in the original solution for each $n \geqq 12$ satisfy the conditions, by directly expressing the corresponding differences $s_{1}-s_{2}$ and $s_{2}-s_{3}$, which we need to show are both positive. We will use the expression $n=3 k+r$ and write the elements of the proposed sets in descending order:

$$
\begin{aligned}
& \mathrm{M}_{1}: \quad 3 k+r \quad 3 k+r-1 \quad \ldots \quad 2 k+r+2 \\
& \mathrm{M}_{2}: \quad 2 k+r+1 \quad 2 k+r \quad \ldots \quad k+r+3 \quad k+r+2 \\
& \begin{array}{llllll}
\mathrm{M}_{3}: & k+r+1 & k+r & \ldots & r+3 & r+2
\end{array} r+1 \quad \ldots
\end{aligned}
$$

(The three dots in the last row represent the numbers $r, \ldots, 1$ in the case $r>0$.)

Notice that the elements of sets $\mathrm{M}_{1}$ and $\mathrm{M}_{2}$ written below each other have the same difference, equal to the number $k-1$. There are $k-1$ such pairs, and in set $\mathrm{M}_{2}$ there is an additional (k-th) number $k+r+2$. This leads to the first of the formulas

$$
s_{1}-s_{2}=(k-1)^{2}-(k+r+2), \quad s_{2}-s_{3}=k^{2}-\sum_{j=1}^{r+1} j
$$

The second formula can be derived by a similar argument about the elements of sets $\mathrm{M}_{2}$ and $\mathrm{M}_{3}$, also written below each other. That both obtained differences are positive under the assumptions $k \geqq 4$ and $r \in\{0,1,2\}$ is evident:

$$
\begin{aligned}
& s_{1}-s_{2} \geqq(k-1)^{2}-(k+4)=k(k-3)-3 \geqq 4 \cdot 1-3=1, \\
& s_{2}-