Solution (source code)

= Solution

The <state space> is $\{0,1,\ldots,N\}$, with initial state $X_1=N$. With rows indexed by the current state and columns by the next state, the <transition matrix> is
$$
\boxed{P_{ij}=\begin{cases}
1,&i=j=0,\\
1/i,&1\leq i\leq N,\quad0\leq j<i,\\
0,&\text{otherwise}.
\end{cases}}
$$
The state strictly decreases at each step until absorption at $0$.