An experiment draws values uniformly at random among $k\ge1$, and stops when it is drawn a value identical to a previous one. The experiment's outcome $n$ is the number of draws before collision, an integer in range $[1,k]$.
What's a little-o expression for the mean outcome $\bar n$ as $k$ goes to infinity?
Probability of an outcome at least $n$ is $q_n=\displaystyle\prod_{j=0}^{n-1}{k-j\over k}\;=\;{k!\over(k-n)!\;k^n}$.
The Stirling approximation allows to derive $q_n\approx e^{-\frac{n^2}{2k}}$ for large $k$ and $n\ll k$. The median outcome is thus $o\left(2\sqrt{\log2}\,\sqrt k\right)$ with $2\sqrt{\log2}=1.1774\ldots$.
I get a mean outcome $\bar n=\displaystyle\sum_{0<i\le k}\frac{k!}{(k-i)!\,k^i}$ and from that numerical evidence $\bar n=o\left(\left(1.253\pm0.002\right)\sqrt k\,\right)$ but fail to derive the exact multiplicative constant.
Context is cryptography.
This looks like $\sqrt{\pi/2}$.
The terms have a logarithm that looks like the integral of minus $x$, so they have shape $exp(-x^2/2)$. Then summing them gives the integral from 0 to infinity.