Solution (source code)

= Solution

Apply the <law of total expectation> to the bounded <random variable> $R_{k+1}$. <Linearity of expectation> gives
$$
r_{k+1}=\mathbb E\!\left[\mathbb E[R_{k+1}\mid R_k]\right]
=\mathbb E\!\left[1+\left(1-\frac2n\right)R_k\right]
=\boxed{1+\left(1-\frac2n\right)r_k}.
$$
This also holds for the first step from $r_0=n$.