For $n \in \mathbb N$, consider the following experiment :
1) choose a random number in $[\![ 1, n ]\!]$
2) if the number wasn't already chosen, write it on a piece of paper
3) repeat 1) and 2) until all the set $[\![ 1, n ]\!]$ is listed on your piece of paper
Let $X$ be the number of tries it took to finish the experiment, what is the expected value of $X$?
I began by solving the case $n = 2$ :
For $k \in [\![ 2, \infty [\![, \mathbb P(X = k) = \frac{1}{2^{k-1}}.$
So,
$$ \mathbb E(X) = \sum_{k = 2}^\infty\frac{k}{2^{k-1}} = 2 \cdot \sum^\infty_{k = 1}\frac{k}{2^{k}} - 1 = 3.$$
I need help for the general case.