<s>[INST] Sum of a series problem involving cubes For any odd integer $n$, evaluate $n^3 - (n-1)^3 + \cdots + (-1)^{n-1} \cdot 1^3 = \sum_{k=1}^n (-1)^{k+1}\cdot k^3$
How would you go about solving such a problem?
Any help would be appreciated.
 [/INST] Just split the problem up into "odd" and "even" cases and use Faulhaber's formula (this is perhaps the most straightforward way); e.g.:
$$\begin{align}
7^3-6^3+5^3-4^3+3^3-2^3+1^3 \\
&= (7^3+6^3+5^3+4^3+3^3+2^3+1^3)-2(6^3+4^3+2^3) \\
&=(7^3+6^3+5^3+4^3+3^3+2^3+1^3)-2(6^3+4^3+2^3) \\
&=(7^3+6^3+5^3+4^3+3^3+2^3+1^3)-2((2^3)(3^3+2^3+1^3)) \\
&=(7^3+6^3+5^3+4^3+3^3+2^3+1^3)-16(3^3+2^3+1^3)
\end{align}$$
Alternatively, notice that if we define:
$$A_n = \sum_{k=1}^n{((-1)^{n-k} \cdot k^3)}$$
for the terms in a sequence, then:
$$A_n + A_{n+1} = (n+1)^3$$
It goes kind of like this: Define $f(x)$ to be:
$$f(x) = \sum_{k=0}^\infty{(A_kx^k)}$$
Then, calculate $(x+1)f(x)=xf(x)-f(x)$ (as a rational function) by applying:
$$A_n + A_{n+1} = (n+1)^3$$
This gives the generating function of $f(x)$ (it is a rational function). Expand it using partial fractions; each partial fraction is a geometric series or a power (i.e., derivative) of a geometric series.
Express each partial fraction as a simple series, add them, and equate coefficients to $A_n$. And you get the answer!!!
See the sequence at OEIS, for example.
The answer is:

$$\frac{1}{2}n^3 + \frac{3}{4}n^2-\frac{1}{8}+\frac{1}{8}(-1)^n$$

</s>