I am trying to understand the partition function of $N$ copies of 1D bosonic harmonic oscillator. $$ Z_N{}^B = q^{\frac{N}{2}} \prod_{n=1}^N \frac{1}{1-q^n}\quad\text{ with }\quad q=e^{-\beta \hbar w}.$$
My trial are follows
For bosonic case, Hilbert space is spanned by states labelled $N$ integers such that, $0\leq k_1 \leq k_2 \leq \cdots k_n \cdots \leq k_N$, The energy states can be \begin{align} H |k_1, \cdots k_N> = \left( \frac{N}{2} + \sum_{n=1}^N k_n \right) | k_1, \cdots k_N> \end{align} Then partition function \begin{align} Z_N{}^B &= tr(q^H) = q^{\frac{N}{2}} \sum_{k_1=0}^{\infty} \sum_{k_2=k_1}^{\infty}\cdots \sum_{k_N=k_{N-1}}^{\infty} q^{\sum_{n=1}^N k_n} \\ & = q^{\frac{N}{2}} \prod_{n=1}^N \frac{1}{1-q^n} \end{align}
what i have trouble with is the step of first line to second line.
First what think about the first term $(1+q+q^2+ \cdots)$, are the case of $k_2=k_3=\cdots k_N=0$, so $\sum_{k_1=0}^{\infty} q^{k_1}=1+q+q^2+\cdots$
then how i can inteprete the second term via $k_2, \cdots?$ $(1+q^2+ \cdots)?$
I found some wrong points in my formula, i correct it. Then it makes sense.