The sum of the first $\mathrm{n}$ terms of the series $\mathrm{I}^{2}+2 \cdot 2^{2}$ $+3^{2}+2 \cdot 4^{2}+5^{2}+2 \cdot 6^{2}+\ldots$ is $\frac{n(n+1)^{2}}{2}$ when $n$ is
even. When $n$ is odd the sum is $\quad$ [2004]
(A) $\frac{3 n(n+1)}{2}$
(B) $\frac{n^{2}(n+1)}{2}$
(C) $\frac{n(n+1)^{2}}{4}$
(D) $\left[\frac{n(n+1)}{2}\right]^{2}$