We have an isolated assembly of N indistinguishable harmonic oscillators, each has energy $\epsilon_i=\hbar \omega/2 + n_i \hbar\omega$, where $n_i$ is a non-negative integer. If the total energy of the system is $E=N\hbar\omega/2 + M\hbar\omega$, ($N\gg 1$) then each micro-state must satisfy

$$

\sum_{i=1}^{N}\epsilon_i =E\quad\Longrightarrow \quad \sum_{i=1}^N n_i=M

$$

To determine micro-canonical entropy we need to know the number of possible ways for this relationship to be satisfied. I was trying to deduce a formula, or find some relationship of recurrence:

If $M=0$

$$

n_i=0\quad\forall i\quad\Longrightarrow\quad\omega(E)=\dfrac{N!}{N!}=1,

$$

If $M=1$

$$

n_i=0\quad\forall i \not=j\;\;, \wedge, \;\; n_j=1\quad$$ $$

\Longrightarrow\quad\omega(E)=\dfrac{N!}{(N-1)!}=N,

$$

If $M=2$

$$

\begin{cases}n_i=0\quad\forall i \not=j&, \wedge, \;\; n_j=2\\

n_i=0\quad\forall i \not=j_1,j_2&, \wedge, \;\; n_{j_1}=1= n_{j_2}

\end{cases}

\quad$$ $$\Longrightarrow\quad

\begin{cases}

\omega_1=\dfrac{N!}{(N-1)!}=N,\\

\omega_2=\dfrac{N!}{(N-2)!2!}=\dfrac{N(N-1)}{2},\\

\end{cases}\quad $$ $$ \Longrightarrow\omega(E)=\omega_1+\omega=\dfrac{N(N+1)}{2}

$$

In the same way, if $M=3$

$$

\begin{cases}

\omega_1=N\\

\omega_2=\frac{N!}{(N-2)!}=N(N-1)\\

\omega_3=\frac{N!}{(N-3)!(3!)}=\frac{N(N-1)(N-2)}{3!}

\end{cases}\Longrightarrow\quad\omega(E)=\omega_1+\omega_2+\omega_3=\frac{N(N+1)(N+2)}{3!}

$$

Then for a non-negative integer $M$,

$$

\omega(E)=\frac{\displaystyle\prod_{i=0}^{M-1}(N+i) }{M!}\overset{?}{=}\frac{(N+M-1)!}{M!(N-1)!}=

\begin{pmatrix}

N+M-1\\N-1

\end{pmatrix}

$$

But it is not clear to me, Is okay?, Is there another way to get this?, How I interpret this result?