Find the sum of the series $1^3 + 3\cdot 2^2 + 3^3 + 3\cdot 4^2 + 5^3 + 3\cdot 6^2...$ up to $n$ terms 
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. 

Details for your comment above:
$n$ is even:
$$\sum_{1}^{n/2} (2k-1)^{3} +3 \sum_{1}^{n/2} (2k)^{2}$$
Example:
$$1^3 + 3\cdot 2^2 = \sum_{k=1}^{2/2}(2k-1)^3+3\sum_{k=1}^{2/2}(2k)^2$$
$n$ is odd:
$$\sum_{1}^{(n+1)/2} (2k-1)^{3} +3 \sum_{1}^{(n+1)/2-1} (2k)^{2}$$
Example:
$$1^3 + 3\cdot 2^2 + 3^3 = \sum_{k=1}^{(3+1)/2}(2k-1)^3+3\sum_{k=1}^{(3+1)/2-1}(2k)^2$$
