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.
 A: 
$$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} $$
A: Let $n$ be even. Then: 
$$S(n+1)-S(n)=(n+1)^2 \Rightarrow$$
$$S(n+1)=\frac{n(n+1)^2}{2}+(n+1)^2=\frac{(n+1)^2(n+2)}{2}.$$
A: I think part of your problem is ambiguous notation. 
You say that $n$ is odd, and you write $1^2+3^2+\cdots+n^2,$ which makes sense: it is a finite sequence of squares of consecutive odd numbers from $1$ to $n.$
But in the very same equation you write 
$2^2+4^2+\cdots+n^2.$ 
What does the second expression even mean? It cannot be a sequence of even numbers, because $n$ is odd. It is not a sequence of odd numbers either. Does it start even and change to odd somewhere?
Where does it change? When it changes from even to odd, does it include the squares of two consecutive numbers or does it skip a number?
Then, having written a sum of two expressions for $n$ odd that makes no sense but that looks (notationally) like an expression whose value you know when $n$ is even, you assume the same formula will apply also when $n$ is odd, and you apply it. 
By the time you have done these two things, there is no reason to think that the result will have any relationship to any true mathematical fact. 
A: For $n$ odd case: $$\big(1^2+3^2+\cdots +n^2\big)+2\big(2^2+4^2+\cdots+(n-1)^2\big) \\= \big(1^2+3^2+\cdots +n^2\big)+2\big(2^2+4^2+\cdots+(n+1)^2\big) - 2(n+1)^2 \\= \frac{(n+1)(n+2)^2}{2} - 2(n+1)^2 \\= \frac{n^2(n+1)}{2}.$$
Let $T1$ denote number of terms contributed by odd indexes (for example $1^2, 3^2$ etc) and $T2$ denote number of terms contributed by even indexes (for example $2.2^2, 2.4^2$ etc). Note that, for $n$ odd case, $T1 = T2 + 1$ and for $n$ even case, $T1 = T2$.
