If $L/K$ is a degree $n$ number field extension, then a statement in a book says that if $L/K$ is unramified outside a finite set $S$ of prime ideals in $B=\mathcal{O}_K$, then the discriminant, $D(L/K)$, regarded as a principal ideal in $B$, is a divisor of $$\prod_{\mathfrak{p}\in S}\mathfrak{p}^{n(n+1)}.$$
A previous result says that $\mathfrak{p}|D(L/K)\iff $ $\mathfrak{p}$ is ramified in $L$. However, I am clueless on how the exponent of $n(n+1)$ is obtained. Please help. Thanks.
This does not seem to be correct. Suppose that the degree is $n = 2$.
Let $K = \mathbf{Q}(\zeta_{2^n})$ and let $L = \mathbf{Q}(\zeta_{2^{n+1}})$ for $n \ge 2$. Then
$$v_2(\Delta_{K/\mathbf{Q}}) = (n-1) 2^{n-1},$$ $$v_2(\Delta_{L/\mathbf{Q}}) = n 2^n,$$
We have the formula for the discriminants of a tower of number fields as follows:
$$\Delta_{L/\mathbf{Q}} = N_{K/\mathbf{Q}}(\Delta_{L/K}) \cdot \Delta^2_K,$$
The prime $2$ is totally ramified in $K$. Let $\mathfrak{p} = (1 - \zeta_{2^n})$ be the prime above $2$, which has norm $2$. If $\Delta_{L/K} = \mathfrak{p}^r$, then we deduce that
$$n 2^n = v_2(\Delta_{L/\mathbf{Q}}) = r + 2(n-1) 2^{n-1},$$
and thus $r = n 2^n - (n-1) 2^n = 2^n$. In particular, if $n \ge 3$, then $r \ge 2^3 = 8 > 6$.
Explicitly, if $K = \mathbf{Q}(\zeta_8)$ and $L = \mathbf{Q}(\zeta_{16})$, then $\mathfrak{p} = (1 - \zeta_8)$ is prime and $\Delta_{L/K} = \mathfrak{p}^8$.