Rolling an $n$-sided die until repeat is found Problem: We are rolling an $n$-sided die. You roll until you reach a number which you have rolled previously. I need to calculate the probability $p_m$ that we have rolled $m$ times for such a repeat.
My first thought was to try some inputs. I took $n=6$. I noticed that when $m=1$, we will always get a probability of $0$, since you are only rolling one time. Also, for $m>7$, we will also have $0$, since we will never reach that case. Now, I don't get how to find a general formula for when $1<m<8$

for a die with $n$ sides, if you haven't already seen a duplicate, the probability of getting a repeat on the $k$th roll is
$$\frac{k-1}{n}$$
So, to get a repeat exactly on the $j$ you must first succeed at getting to the $j$th roll without any repeats, and then roll a repeat:
$$\begin{align}P(j) &= \frac{j-1}{n}\cdot\prod_{k=1}^{j-1}\left(1-\frac{k-1}{n}\right)\\
&=\frac{j-1}{n}\cdot\prod_{k=1}^{j-1}\left(\frac{n+1-k}{n}\right)\\
&=\frac{j-1}{n^j}\cdot\prod_{k=1}^{j-1}\left(n+1-k\right)\\
&=\frac{j-1}{n^j}\cdot\left(n\times(n-1)\times\cdots\times(n+3-j)\times(n+2-j)\right)\\
&=\frac{j-1}{n^j}\cdot\frac{n!}{(n+1-j)!}\\
&=\frac{n!\cdot(j-1)}{(n+1-j)!\cdot n^j}\end{align}$$
