The sum of first $n$ terms of the series
$1^{2}+2.2^{2}+3^{2}+2.4^{2}+5^{2}+5.6^{2}+\ldots$ is $\frac{n(n+1)^{2}}{2}$
when $n$ is even. When $n$ is odd, the sum is
(A) $\frac{n^{2}(n+1)}{2}$
(B) $\frac{n(n+1)^{2}}{2}$
(C) $\left[\frac{n(n+1)}{2}\right]^{2}$
(D) $\frac{n(n+1)}{2}$