Let $X \sim \mathcal{N}(0,\sigma^2)$. Find $E[X^n]$, where $n \in N$.
What I did was comparing two forms of MGFs, one using the definition of expectation and the other one using taylor series:
$$M_X(s) = e^{\frac{\sigma^2s^2}{2}} = \sum_{n=0}^\infty \frac{(\sigma s)^{2n}}{2^nn!}$$
$$M_X(s) = E[e^{sX}] = \sum_{n=0}^\infty \frac{s^n}{n!} \cdot E[X^n]$$
Then I equate them: $\frac{(\sigma s)^{2n}}{2^nn!} = \frac{s^n}{n!}\cdot E[X^n]$, but this gives me $E[X^n] = \Big(\frac{\sigma^2s}{2}\Big)^n$, which does not make sense because it contains the parameter $s$. Where did I do wrong ? Thanks.
The $n^\textrm{th}$ moment is the $n^\textrm{th}$ derivative of $M_X(s)$ evaluated at $s=0$.
$$m_n = \left. \frac{d^n M_X(s)}{ds}\right|_{s=0}$$
For example, for the Gaussian centered at zero that you indicate,
$$m_1 =\left. s\sigma^2 e^{\frac{1}{2} \sigma^2 s^2}\right|_{s=0} =0$$ and $$m_2= \left. (s^2 \sigma^4 + \sigma^2)e^{\frac{1}{2} \sigma^2 s^2}\right|_{s=0} = \sigma^2.$$
$$\underline{\textbf{UPDATE, based on your question below:}}$$
$${}{}{}$$
$$ \sum_{k=0}^{\infty}m_k \cdot \frac{s^k}{k!} = \sum_{n=0}^{\infty}\frac{(\sigma s)^{2n}}{2^nn!} $$
If $k$ odd, $m_k=0$.
If $k$ even, $k=2n$ and
$$m_k = \frac{\sigma^k k!}{ 2^{k/2} (k/2)!}$$
which allows us to write
$$\begin{aligned} m_1&=0\\ m_2&=\sigma^2\\ m_3&=0\\ m_4&= \frac{4! \sigma^4}{4 \cdot 2!}=3\sigma^4\\ m_5&=0\\ &\textit{etc.} \end{aligned}$$