This is a pure algebraic question. Drawing a sample of size $n$ from a Gaussian population $N(0, \sigma^2)$, the posterior probability of $\sigma$ is proportional to $\frac{1}{\sigma^{n+1}} e^{-(s/\sigma)^2}$, where s is the standard deviation of the sample. To get the mean standard deviation,
\begin{equation} \begin{split} \langle\sigma^2\rangle & = C\int_0^\infty \sigma^2\sigma^{-n-1}e^{-n(s/\sigma)^2} \, d\sigma \\[8pt] & = \frac{ns^2}{n-2} \\[8pt] & = \frac{1}{n-2}\sum_i (x-\mu)^2 \end{split} \end{equation}
Does anyone have idea how the integral is made? It is not a regular integral that can be found in a common Gaussian integral table.