<s>[INST] How to construct an example where $\sum_{n=1}^{+\infty} a_n$ diverges and $\prod_{n=1}^{+\infty} (1+a_n)$ converges? 
My Problem: Construct an example where
$$ \sum_{n=1}^{+\infty} a_n \quad \text{diverges}, \qquad \text{and}\qquad \prod_{n=1}^{+\infty} (1 + a_n) \quad \text{converges}$$

My thoughts:
By '$\prod _{n=1}^{+\infty} (1 + a_n)$ converges', we have $a_n \to 0$, and by '$\sum_{n=1}^{+\infty} a_n$ diverges', we know that the sign of $\{a_n\}$ is not fixed. But I have no idea how to construct the $a_n$.
Please give me some hints to do it. Thanks a lot!
And how can I construct the ${a_n}$ when it is not constant?
 [/INST] Some author says that $\prod_{n=1}^{\infty}(1 + a_n)$ is convergent only if
$$ \lim_{N\to\infty} \prod_{n=1}^{N} (1+a_n) \in \mathbb{C}\setminus\{0\}. $$
This definition has some advantages over the more lenient version that allows $0$ as a possible value of infinite product, see the related Wikipedia article for instance.
Even with this definition, we are still able to construct an example.

Construction. Define $(a_n)_{n\geq 1}$ so as to satisfy
$$ (1+a_n)_{n\geq 1} = \left( 1, \quad \frac{2}{1}, \frac{1}{2}, \quad \frac{3}{2}, \frac{2}{3}, \frac{3}{2}, \frac{2}{3}, \quad \frac{4}{3}, \frac{3}{4}, \frac{4}{3}, \frac{3}{4}, \frac{4}{3}, \frac{3}{4}, \frac{4}{3}, \frac{3}{4}, \quad \ldots \right) $$
By the construction, it is clear that $\prod_{n=1}^{\infty} (1 + a_n) = 1$. On the other hand,
$$ (a_n)_{n\geq 1} = \left( 0, \quad \frac{1}{1}, -\frac{1}{2}, \quad \frac{1}{2}, -\frac{1}{3}, \frac{1}{2}, -\frac{1}{3}, \quad \frac{1}{3}, -\frac{1}{4}, \frac{1}{3}, -\frac{1}{4}, \frac{1}{3}, -\frac{1}{4}, \frac{1}{3}, -\frac{1}{4}, \quad \ldots \right), $$
and so,
$$ \sum_{n-1}^{2^N - 1} a_n
= \sum_{k=2}^{N} \sum_{n=2^{k-1}}^{2^k - 1} a_n
= \sum_{k=2}^{N} 2^{k-2} \left( \frac{1}{k-1} - \frac{1}{k} \right)
= \sum_{k=2}^{N} \frac{2^{k-2}}{k(k-1)} $$
and this diverges as $N \to \infty$. Using this, it is then not hard to check that $\sum_{n=1}^{\infty} a_n = \infty$.
</s>