average length of "harmonic walk" mod $n$ is $\ln(n)$ -- why?

We have $$\operatorname P[L = n] = \frac 1 2 \frac 2 3 \cdots \frac {n - 1} n \frac 1 {n + 1} = \frac 1 {n (n + 1)} [n \geq 1], \\ \operatorname P[(L \bmod m) = n] = \sum_{k \geq 0} \operatorname P[L = m k + n] \,[0 \leq n < m], \\ \operatorname E[L \bmod m] = \sum_{0 < n < m} \sum_{k \geq 0} \frac n {(m k + n) (m k + n + 1)} = \\ \sum_{0 < n < m} \frac n m \left( \psi {\left( \frac {n + 1} m \right)} - \psi {\left( \frac n m \right)} \right) = \\ \psi(1) - \frac 1 m \sum_{0 < n \leq m} \psi {\left( \frac n m \right)} = \ln m.$$ The last identity follows from $$\Gamma(m z) = m^{m z - 1/2} (2 \pi)^{(1 - m)/2} \prod_{0 < n \leq m} \Gamma {\left( z + \frac {n - 1} m \right)}.$$


If the $k^{\text{th}}$ turn has a probability of $\frac1k$ of ending the walk, then the overall probability that the walk ends on turn $k$ and not before is $\frac12 \cdot \frac23 \cdots \frac{k-2}{k-1} \cdot \frac1k = \frac{1}{k(k-1)}$. So the probability that the walk ends on a turn that's $k$ modulo $n$ is $$\frac{1}{k(k-1)} + \frac{1}{(n+k)(n+k-1)} + \frac{1}{(2n+k)(2n+k-1)} + \dots$$ for $k=2,\dots,n-1$, dropping the first term for $k=0$ and $k=1$.

We have $\frac{1}{(jn+k)(jn+k-1)} \le \frac{1}{j^2(n-1)^2}$ so the sum of all the terms except the first can be upper-bounded by $\frac{1}{(n-1)^2}(\frac11 + \frac14 + \frac19 + \dots) = \frac{\pi^2}{6(n-1)^2}$. So if $X$ is the value of the walk mod $n$ then its expected value satisfies $$ \sum_{k=2}^{n-1} k \cdot \frac{1}{k(k-1)} \le \mathbb E[X] \le \sum_{k=2}^{n-1} k \cdot \frac{1}{k(k-1)} + \sum_{k=0}^{n-1} k \cdot \frac{\pi^2}{6(n-1)^2}. $$ The lower bound simplifies to the $(n-2)^{\text{th}}$ harmonic number $H_{n-2}$, which is well-approximated by $\ln n$ up to a constant error. The error term in the upper bound simplifies to $\binom n2 \frac{\pi^2}{6(n-1)^2}$, which approaches $\frac{\pi^2}{12}$ as $n \to \infty$.

This is not a complete answer - it doesn't explain why the constant errors cancel out. But it's a start.