Assume there is a box with N elements inside and you randomly draw one element with replacement. You keep doing this until you draw an element you've already drawn before. Each element has equal chance to be picked. Let X denote the number of the first draw on which you get an element you've already seen. X is a random variable and can be described with the following PMF: $p_{X}(k)=\frac{(k-1)N!}{N^k(N-k+1)!}$ for $k \in \{ 1,2,3,...,N+1 \}$, otherwise 0.
I want to find E[X] so:
$E[X]=\sum_{k=1}^{N+1} \frac{k(k-1)N!}{N^k(N-k+1)!}=\sum_{k=0}^{N}\frac{(k+1)kN!}{N^{k+1}(N-k)!}=\sum_{k=0}^{N}{N \choose k}\frac{(k+1)!k}{N^{k+1}}$
I tried a few simple algebraic manipulations but that got me nowhere. So i just calculated E[X] for the first few N and looked it up in OEIS. It seems $E[X]=\int_0^\infty e^{-x}(1+\frac{x}{N})^Ndx$ and Mathematica told me it's also equal to $(\frac{e}{N})^N\Gamma(N+1,N)$
How can I arrive at this result? How do I convert those sums into an integral or a gamma function?
By exploiting the integral representation for the $\Gamma$ function you have: $$\mathbb{E}[X]=\sum_{k=0}^N \binom{N}{k}\frac{k(k+1)!}{N^{k+1}}=\int_{0}^{+\infty}\sum_{k=0}^N \binom{N}{k}\frac{k x^{k+1}}{N^{k+1}}e^{-x}\,dx\tag{1}$$ but: $$\sum_{k=0}^{N}\binom{N}{k}\frac{kx^{k+1}}{N^{k+1}}=\frac{x^2}{N}\cdot\frac{d}{dx}\sum_{k=0}^{N}\binom{N}{k}\frac{x^k}{N^k}=\frac{x^2}{N}\cdot\frac{d}{dx}\left(1+\frac{x}{N}\right)^N=\frac{x^2}{N}\left(1+\frac{x}{N}\right)^{N-1}\tag{2}$$ so: $$\mathbb{E}[X]=\int_{0}^{+\infty}\frac{x^2}{N}\left(1+\frac{x}{N}\right)^{N-1}e^{-x}\,dx.\tag{3}$$ The integrand function has a maximum in $x=\frac{1+\sqrt{8N+1}}{2}$. By approximating the integrand function with a Poisson distribution, or just applying the saddle point method, I am expecting that: