Solution (source code)

= Solution

Every reachable <sequence> is a restricted-growth <sequence> in $A_n$. Given one, the transition masses sum to
$$
\frac{\sum_{i=1}^{M}(N_i-1/2)+1+M/2}{n+1}=1,
$$
and every allowed transition remains in $A_{n+1}$. Induction from $X_1=1$ therefore proves that $(X_1,\ldots,X_n)\in A_n$ almost surely.