<s>[INST] Point out my fallacy, in sequence and series. 
The sum of the first $n$--terms of the series $1^2+2\cdot2^2+3^2+2\cdot4^2+\cdots$ is $\dfrac{n(n+1)^2}{2}$, when $n$ is even. When $n$ is odd, the sum is?

I got the correct answer when is replaced $n\rightarrow (n+1)$ to make above valid for odd, but when I tried the different approach then something following had happened.
For $n$ even, last term $=n$ which is even and term before it $=n-1$ which is odd. Clubbing all odds and evens separately as follows:
$\big(1^2+3^2+\cdots +(n-1)^2\big)+2\big(2^2+4^2+\cdots+n^2\big)=\dfrac{n(n+1)^2}{2}\tag{1}$
For $n$ odd, last term $=n$ which is odd and term before it $=n-1$ which is even. Clubbing all odds and evens separately as follows:
$\big(1^2+3^2+\cdots +n^2\big)+2\big(2^2+4^2+\cdots+(n-1)^2\big)\tag*{}$
$=\big(1^2+3^2+\cdots +(n-1)^2\big)+2\big(2^2+4^2+\cdots+n^2\big)-n^2+(n-1)\tag*{}$
From equation $(1)$
$=\dfrac{n(n+1)^2}{2}-n^2+(n-1)\tag*{}$
And answer given is: $\dfrac{n^2(n+1)}{2}$
please help.
 [/INST] 
$$1^2+2^2+3^2+...N^2=\frac {N (N+1)(2N+1)}{6} $$

If $n $ is odd if the form $2p+1$,
the sum is
$$1+2.2^2+3^2+...2. (2p)^2+(2p+1)^2=$$
$$(1+2^2+3^2+... (2p+1)^2)+(2^2+4^2+... (2p)^2=$$
$$\frac {n (n+1)(2n+1)}{6}+4.\frac {p (p+1)(2p+1)}{6} =$$
$$\frac {n (n+1)(2n+1)+(n-1)(n+1)n}{6}=$$
$$\frac {n ^2(n+1)}{2} $$
</s>