Let $X_i$ be a sequence of discrete i.i.d. random variables taking values in $\{ 1, \dots, K \}$, $K \in \mathbb{N}$ with given distribution $p_j = P(X_1 = j)$. Set $S_n := \sum_{i=1}^n X_i$ and for $M \geq 0$ consider the number of summation steps $N := \inf \{ n \mid S_n \geq M \}$ until the sum reaches $[M, \infty)$. Is there some closed-form expression for $\mathbb{E}[N]$ in terms of the given data ($p_j$, $M$)?
I know that one can formalize this problem as a discrete phase-type distribution comprising a discrete-time Markov chain on the finite state space $\{ 0, 1, \dots, M+K-1 \}$ with initial state $0$, absorbing states $M, \dots, M+K-1$ and transitions $k \to k+j$ with probability $p_j$ for $k = 0, \dots, M-1$. Then $N$ is the (discrete) time until absorption and there is an expression for $\mathbb{E}[N]$ in matrix notation as $\delta_0 (I - T)^{-1} \mathbf{1}$ where $T$ is the transition probability matrix for the transient part. My hope is that one can simplify this expression directly in terms of ($p_j$, $M$) by e.g. some matrix-geometric methods since $T$ has a simple upper triangular form: $$ T = \begin{pmatrix} 0 & p_1 & \dots & p_K & 0 & 0 & \dots & 0 \\ & 0 & p_1 & \dots & p_K & 0 & \dots & 0 \\ & & \ddots & \ddots & & \ddots & \\ 0 & 0 & \dots & & & & \dots & 0 \end{pmatrix} \in \mathbb{R}^{(M-1) \times (M-1)} $$ (On each next row, the row vector $(p_1, \dots, p_K)$ is shifted to the right-hand side until the last row is completely $0$ (the only transitions from state $M-1$ are to the absorbing states $M, \dots, M+K-1$).)