4. Given the complex sequence $\left\{a_{n}\right\}$ with the general term $a_{n}=(1+i)\left(1+\frac{i}{\sqrt{2}}\right)\left(1+\frac{i}{\sqrt{3}}\right) \cdots$
- $\left(1+\frac{i}{\sqrt{n}}\right)$.

Then $\left|a_{n}-a_{n+1}\right|=$ ( ).
(A) $\frac{\sqrt{2}}{2}$.
(B) $\sqrt{2}$.
(C) 1 .
(D) 2 .
4. (C).

First, prove that $\left|a_{n}\right|=\sqrt{n+1}$. Use mathematical induction. When $n=1$, $\left|a_{1}\right|=|1+i|=\sqrt{1+1}$, the conclusion holds.
Assume that when $n=k$, $\left|a_{k}\right|=\sqrt{k+1}$ holds. Then when $n=$ $k+1$,
$$
\begin{aligned}
\left|a_{k+1}\right| & =\left|a_{k} \cdot\left(1+\frac{i}{\sqrt{k+1}}\right)\right| \\
& =\left|a_{k}\right| \sqrt{1+\frac{1}{k+1}}=\sqrt{k+1} .
\end{aligned}
$$

Thus, for all $n \in N,\left|a_{n}\right|=\sqrt{n+1}$.
$$
\begin{array}{l}
\quad\left|a_{n}-a_{n+1}\right|=\left|a_{n}-a_{n}\left(1+\frac{i}{\sqrt{n+1}}\right)\right| \\
=\left|-a_{n} \cdot \frac{i}{\sqrt{n+1}}\right|=\left|a_{n}\right| \cdot\left|\frac{i}{\sqrt{n+1}}\right| \\
=\sqrt{n+1} \cdot \frac{1}{\sqrt{n+1}}=1 .
\end{array}
$$