5.9 The sequence $101, 104, 116, \cdots$ has the general term $a_{n}=100+n^{2}$, where $n=1$, $2, 3, \cdots$. 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}$. Here $n$ takes all positive integers.
(3rd American Invitational Mathematics Examination, 1985)
［Solution］We can prove a more general conclusion:
If $a$ is a positive integer, and $d_{n}$ is the greatest common divisor of $a+n^{2}$ and $a+(n+1)^{2}$, then when $n=2a$, $d_{n}$ reaches its maximum value of $4a+1$.
Since $d_{n}$ is the greatest common divisor of $a+n^{2}$ and $a+(n+1)^{2}$, then
$$
\begin{array}{c}
d_{n} \mid\left(a+n^{2}\right), \\
d_{n} \mid\left[a+(n+1)^{2}\right] .
\end{array}
$$

Thus,
$$
d_{n} \mid\left[a+(n+1)^{2}\right]-\left(a+n^{2}\right) .
$$

That is,
$$
d_{n} \mid(2 n+1) .
$$

Since $2\left(a+n^{2}\right)=n(2 n+1)+(2 a-n)$, then by
$$
d_{n}\left|\left(a+n^{2}\right), \quad d_{n}\right|(2 n+1)
$$

we get
$$
d_{n} \mid(2 a-n) .
$$

From (1) and (2), we know $d_{n} \mid \left.\left.2 n+1\right)+2(2 a-n)\right]$, that is,
$$
d_{n} \mid(4 a+1) \text {. }
$$

Therefore,
$$
1 \leqslant d_{n} \leqslant 4 a+1 \text {. }
$$

Next, we prove that $d_{n}$ can reach $4a+1$.
In fact, when $n=2a$,
$$
\begin{aligned}
a+n^{2} & =a(4 a+1), \\
a+(n+1)^{2} & =(a+1)(4 a+1) .
\end{aligned}
$$

Since
$$
(a, a+1)=1 \text {, }
$$

the greatest common divisor of $a+n^{2}$ and $a+(n+1)^{2}$ is $4a+1$.
Therefore, the maximum value of $d_{n}$ is $4a+1$.
In particular, when $a=100$, the maximum value of $d_{n}$ is 401.