A box contains $n$ balls numbered from 1 to $n$. Suppose you take a ball at a time, putting it back on the box, until you pick a ball twice. How many balls are you expected to take from the box?
Let $X$ be the r. v. of interest. Its support is every natural number from $2$ to $n+1$. If $k$ is one such number, to get the first repetition on the $k$-th pick, the $k-1$ previous ones must be distinct and $k$-th equal to some of those, therefore, $$\begin{align} \forall k\in\mathbb N\cap[2,\,n\!+\!1]\qquad \mathbb P(X=k) &= \frac nn\frac {n-1}n\ldots\frac {n-(k-2)}n \;\cdot\; \frac{k-1}n =\\ &=\frac{(n-1)!}{(n-k+1)!}\frac{k-1}{n^{k-1}} =\\ &= \frac{k-1}n\,\prod_{l=0}^{k-2}\left(1-\frac{l}n\right)\quad, \end{align}$$ so that $$\begin{align} E(X) &= \sum_{k=2}^{n+1}\,k\cdot\frac{k-1}n\,\prod_{l=0}^{k-2}\left(1-\frac{l}n\right) =\\ &=\frac1n\sum_{k=2}^{n+1}\,k(k-1)\prod_{l=0}^{k-2}\left(1-\frac{l}n\right)\quad. \end{align}$$
However, the book answer is $$E(X) = 2 + \sum_{k=1}^{n-1}\prod_{l=1}^k\left(1-\frac ln\right)\quad.$$
What am I doing wrong? Or, if the answers are actually the same, how to show that?