6. (1988 IMO National Training Team Selection Test) Let $n \in \mathbf{N}$ be greater than 3, and have 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$.
6. Let $n \geqslant 3^{5}$, then $3,3^{2}, 3^{4}, 3^{5} \in S_{n}$. Suppose the set $S_{n}$ is 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. Therefore, $3^{2} \in B$; If $3^{4} \in B$, then $3^{2}, 3^{2}, 3^{4} \in B$, which is impossible. Therefore, $3^{4} \in A$; If $3^{3} \in A$, then $3,3^{2}, 3^{4}=3 \cdot 3^{3} \in A$, which is impossible. Therefore, $3^{3} \in B$. Thus, since $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$, dividing $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.
In summary, the smallest value of $n$ that satisfies the condition in the problem is 243.