Find the sum of first $n$ terms of the series $1^3 + 3\cdot 2^2 + 3^3 + 3\cdot 4^2 + 5^3 + 3\cdot 6^2...$
- When $n$ is even.
- When $n$ is odd.
This sum can be written as
$$\sum_{1}^n (2k-1)^{3} +3 \sum_{1}^n (2k)^{2} $$ I can handle the sum up to n terms when it is not specified that $n$ is even or odd. In this problem I'm confused, what changes should be done to get sum for even or odd $n$. In my textbook, $n$ is replaced by $2m$ and then they solved the problem for first $m$ terms and then substituted $m = n/2$ and same is done for odd case, by substituting $n=2m-1$. I didn't get that solution. Any suggestion would be helpful.
HINT
When $n = 2m$ is even, both sums have the same amount of terms, $n/2 = m$ each. When $n = 2m-1$ is odd, the left sum has one more term than the right, so there must be $m$ terms in the left and $m-1$ in the right.
Also notice that the even $n$ sum and the odd $n$ sum are different by just one last term in the right sum.