Example 3 The general term of the sequence $1001,1004,1009$ is $a_{n}=n^{2}+1000$, where $n \in \mathbf{N}_{+}$. For each $n$, let $d_{n}$ denote the greatest common divisor of $a_{n}$ and $a_{n+1}$, find the maximum value of $d_{n}$, where $n$ takes all positive integers.
Let $d_{n}=\left(1000+n^{2}, 1000+(n+1)^{2}\right)$, then $d_{n}\left|\left(1000+n^{2}\right), d_{n}\right|(1000+(n+1)^{2})$. Therefore, $d_{n} \mid\left(1000+(n+1)^{2}-1000-n^{2}\right)$,
which means $d_{n} \mid(2 n+1)$.
Also, since $2\left(1000+n^{2}\right)=n(2 n+1)+2000-n$,
we have $d_{n}\left|(2000-n), d_{n}\right|((2 n+1)+2(2000-n))$, which means $d_{n} \mid 4001$.
Therefore, $1 \leqslant d_{n} \leqslant 4001$.
Furthermore, when $n=2000$, we have $1000+n^{2}=1000+(2000)^{2}=1000 \cdot 4001,1000+(n+1)^{2}=$ $1000+(2000+1)^{2}=1001 \cdot 4001$,
so $d_{n}$ can achieve 4001, i.e., $\left(d_{n}\right)_{\max }=4001$.