Is it true that if $n_1, \dots, n_m \in \mathbf{Z}$ are distinct, then $\mathbf{Z}[x]/((x-n_1)\dots(x-n_m)) \cong \mathbf{Z}^m$? I think the answer is yes, but I'm not sure my argument is correct.
Let $f(x) = (x-n_1)\dots(x-n_m)$ and let $R = \mathbf{Z}[x]/(f(x))$. Since $f(x)$ is monic and the degree of $f(x)$ is $m \geq 1$, $R$ is free over $\mathbf{Z}$ of rank $m$ with basis $\left\{\bar{1}, \bar{x}, \dots, \bar{x}^{m-1}\right\}$. Thus $R \cong \mathbf{Z}^n$.
Is this a correct solution? What if $n_1, \dots, n_m$ aren't necessarily distinct. Is it still true then? It seems so.