Example 2 (2003 Thailand Mathematical Olympiad) Find all prime numbers $p$ such that $p^{2}+2543$ has fewer than 16 distinct positive divisors.
Let $p(p>3)$ be a prime number. It is easy to prove that $p^{2}-1$ is divisible by 24.
It is easy to see that $p^{2}+2543=p^{2}-1+106 \times 24$ is a multiple of 24.
Let $p^{2}+2543=24 k(k \in \mathbf{N}, k \geqslant 107)$.
Suppose $k=2^{r} \times 3^{s} \times k^{\prime}$, where $r, s$ are non-negative integers, and $k^{\prime}$ is a positive integer such that $\left(k^{\prime}, 6\right)=1$. Let $T(n)$ be the number of all positive divisors of $n$. It is clear that
$T\left(p^{2}+2543\right)=T\left(2^{3+r} \times 3^{1+s} \times k^{\prime}\right)=(4+r)(2+s) T\left(k^{\prime}\right)$.
When $k^{\prime}>1$, $T\left(k^{\prime}\right) \geqslant 2$, i.e.,
$T\left(p^{2}+2543\right) \geqslant 16$.
When $k^{\prime}=1$,
$T\left(p^{2}+2543\right)=(4+r)(2+s)$.
If $T\left(p^{2}+2543\right)3)$, we have
$$
T\left(p^{2}+2543\right) \geqslant 16 \text {. }
$$

Consider
$$
\begin{array}{l}
T\left(2^{2}+2543\right)=T(2547)=T\left(3^{2} \times 283\right)=6, \\
T\left(3^{2}+2543\right)=T(2552)=T\left(2^{3} \times 11 \times 29\right)=16,
\end{array}
$$

Only $p=2$ satisfies $T\left(p^{2}+2543\right)<16$.
Therefore, the prime number sought is 2.