7. Let $N$ be a natural number greater than 3, and has the following property: when the set $S_{n}=$ $\{1,2, \cdots, n\}$ is arbitrarily divided into two groups, there is always a group that contains three numbers $a$, $b$, $c$ (allowing $a=b$), such that $a b=c$. Find the smallest value of such $n$.
7. If $n \geqslant 3^{5}$, then $3,3^{2}, 3^{4}, 3^{5} \in S_{n}$.

Let the set $S_{n}$ be divided into two groups $A$ and $B$, with $3 \in A$, and $A$ and $B$ do not satisfy the condition in the problem.
If $3^{2} \in A$, then $3,3,3^{2} \in A$, which is impossible, thus we deduce that $3^{2} \in B$.
If $3^{4} \in B$, then $3^{2}, 3^{2}, 3^{4} \in B$, which is impossible. Thus we deduce that $3^{4} \in A$.
If $3^{3} \in A$, then $3,3^{3}, 3^{4}=3 \cdot 3^{3} \in A$, which is impossible, thus we deduce that $3^{3} \in B$.
Therefore, $3,3^{4} \in A, 3^{5} \in B$, at this point the three elements $3^{2}, 3^{3}, 3^{5}$ in $B$ satisfy $a b=c$, which is a contradiction.
This shows that when $n \geqslant 3^{5}$, dividing the set $S_{n}$ into any two groups, there is always one group that has the property mentioned in the problem, i.e., the required minimum value does not exceed $3^{5}=243$.

On the other hand, take $n=242$, and let $A=\{k \mid 9 \leqslant k \leqslant 80\}, B=\{k \mid 3 \leqslant k \leqslant 8$, or $81 \leqslant k \leqslant 242\}$, then $S_{242}=A \cup B$, and both $A$ and $B$ do not have the property mentioned in the problem.

When $n<242$, divide $S_{n}$ into two groups $A \cap S_{n}$ and $B \cap S_{n}$, then $A \cap S_{n}$ and $B \cap S_{n}$ also do not have the property mentioned in the problem.
Therefore, $n_{\min }=243$.