Example 10 Let $S=\{1,2, \cdots, 2005\}$. If any set of $n$ pairwise coprime numbers in $S$ contains at least one prime number, find the minimum value of $n$.
(2005 China Western Mathematical Olympiad)
First, take a subset $A_{0}=\left\{1,2^{2}, 3^{2}, 5^{2}, \cdots, 41^{2}, 43^{2}\right\}$ of $S$, then $\left|A_{0}\right|=15, A_{0}$ contains any two numbers that are coprime, but there are no primes in it. This indicates that $n \geqslant 16$.

Second, it can be proven: For any $A \subseteq S, n=|A|=16, A$ contains any two numbers that are coprime, then $A$ must contain a prime number.
Proof by contradiction:
Assume $A$ contains no primes. Let $A=\left\{a_{1}, \dot{a}_{2}, \cdots, a_{16}\right\}$.
We consider two cases.
(1) If $1 \notin A$, then $a 1, a_{2}, \cdots, a_{16}$ are all composite numbers. Since $\left(a_{i}, a_{j}\right)=1(1 \leqslant i \leqslant j \leqslant 16)$, the prime factors of $a_{i}$ and $a_{j}$ are all different.
Let the smallest prime factor of $a_{i}$ be $p_{i}$. Without loss of generality, assume $p_{1}2005,
$$
which is a contradiction.
(2) If $1 \in A$, without loss of generality, let $a_{16}=1, a_{1}, a_{2}, \cdots, a_{15}$ be composite numbers.
Similarly, let the smallest prime factor of $a_{i}$ be $p_{i}$. Then, $a_{1} \geqslant p_{1}^{2} \geqslant 2^{2}, a_{2} \geqslant p_{2}^{2} \geqslant 3^{2}, \cdots, a_{15} \geqslant p_{15}^{2} \geqslant 47^{2}>2005$, which is a contradiction.
Thus, $A$ must contain a prime number, i.e., when $n=|A|=16$, the conclusion holds.

In summary, the minimum value of $n$ is 16.