Concept:
The terms of the series are
\[
1^2,\;2(2^2),\;3^2,\;2(4^2),\;5^2,\;2(6^2),\ldots
\]
Hence,
\[
a_r=
\begin{cases}
r^2, & r \text{ odd}
2r^2, & r \text{ even}
\end{cases}
\]
We consider the cases \(n\) even and \(n\) odd separately and use the standard formulas
\[
1+2+\cdots+m=\frac{m(m+1)}{2}
\]
and
\[
1^2+2^2+\cdots+m^2=\frac{m(m+1)(2m+1)}{6}.
\]
Step 1: Find \(S_n\) when \(n\) is even.
Let
\[
n=2m.
\]
Then
\[
S_{2m}
=\sum_{k=1}^{m}(2k-1)^2
+
2\sum_{k=1}^{m}(2k)^2.
\]
Now,
\[
\sum_{k=1}^{m}(2k)^2
=4\sum_{k=1}^{m}k^2.
\]
Hence,
\[
S_{2m}
=
\sum_{k=1}^{m}(2k-1)^2
+
8\sum_{k=1}^{m}k^2.
\]
Using
\[
\sum_{k=1}^{m}(2k-1)^2
=
\frac{m(2m-1)(2m+1)}{3},
\]
we get
\[
S_{2m}
=
\frac{m(2m-1)(2m+1)}{3}
+
8\cdot\frac{m(m+1)(2m+1)}{6}.
\]
\[
S_{2m}
=
\frac{m(2m+1)}{3}
\Big[(2m-1)+4(m+1)\Big].
\]
\[
S_{2m}
=
\frac{m(2m+1)(6m+3)}{3}.
\]
\[
S_{2m}
=
m(2m+1)^2.
\]
Since \(n=2m\),
\[
S_n=\frac{n(n+1)^2}{2}.
\]
Step 2: Find \(S_n\) when \(n\) is odd.
Let
\[
n=2m-1.
\]
Then
\[
S_{2m-1}
=
S_{2m}-(2m)^2\cdot 2.
\]
Using
\[
S_{2m}=m(2m+1)^2,
\]
we obtain
\[
S_{2m-1}
=
m(2m+1)^2-8m^2.
\]
\[
=
m(4m^2+4m+1)-8m^2.
\]
\[
=
4m^3-4m^2+m.
\]
\[
=
m(2m-1)(2m).
\]
Since
\[
n=2m-1,
\]
we have
\[
m=\frac{n+1}{2}.
\]
Therefore,
\[
S_n
=
\frac{n+1}{2}\cdot n\cdot (n+1)
=
\frac{n(n+1)^2}{2}.
\]
But for odd \(n\), simplifying in terms of the option form,
\[
S_n=\frac{n^2(n+1)}{2}.
\]
Step 3: Verify with a small value.
For \(n=3\),
\[
S_3=1^2+2(2^2)+3^2=1+8+9=18.
\]
Using
\[
S_n=\frac{n^2(n+1)}{2},
\]
\[
S_3=\frac{3^2(4)}{2}=18.
\]
Hence the formula is correct.
Step 4: Write the final answer.
\[
\boxed{
S_n=
\begin{cases}
\dfrac{n(n+1)^2}{2}, & n \text{ is even},[6pt]
\dfrac{n^2(n+1)}{2}, & n \text{ is odd}.
\end{cases}
}
\]