Induction of $\sum_{k=1}^{n} (-1)^{n-k}k^2 = \frac{n(n+1)}{2}$ I'm trying to prove following statement through induction:
$\sum_{k=1}^{n} (-1)^{n-k}k^2 = \frac{n(n+1)}{2}$
I have only seen how to prove with induction when the variable $n$ is not included in the sum function. Like here (this statement is not correct, just to provide an example):
$\sum_{k=1}^{n} (-1)^{k}k^2 = \frac{n(n+1)}{2}$
It confuses me and I don't know how to proceed. Any advice?
Thank you.
 A: $$\sum_{k=1}^n(-1)^{n-k}k^2=(-1)^n\sum_{k=1}^n(-1)^{-k}k^2=(-1)^n\sum_{k=1}^n(-1)^kk^2\\\sum_{k=1}^n(-1)^kk^2=(-1)^n\frac{n(n+1)}{2}$$
A: We can derive from scratch as well.  For even $n=2 m$, we can simply pair up the summands to get
$$\sum_{k=1}^{m} ((2 k)^2 - (2 k-1)^2) =  \sum_{k=1}^{m} (4 k-1) = 2 m (m+1) - m = \frac{n (n+1)}{2} $$
For odd $n=2 m+1$, we may do the same, but we have a last (positive) term, and we change the sign of the even part of the sum.  Thus we get
$$(2 m+1)^2 - 2 m (m + 1) + m = 2 m^2 + 3 m + 1 = 2 \left (\frac{n-1}{2} \right )^2 + 3 \left (\frac{n-1}{2} \right ) + 1 = \frac{n (n+1)}{2}$$
A: By induction: for $n=1$:
$$\sum_{k=1}^{1} (-1)^{1-k}k^2 = (-1)^0\cdot 1^2=1=\frac{1\cdot (1+1)}{2} \qquad \checkmark$$
Assume it is true for $n=m$:
$$\sum_{k=1}^{m} (-1)^{m-k}k^2 = \frac{m\cdot (m+1)}{2}$$
Prove for $n=m+1$:
$$\begin{align}\sum_{k=1}^{m+1} (-1)^{m+1-k}k^2 = &\sum_{k=1}^{m} (-1)^{m+1-k}k^2 + (-1)^{m+1-(m+1)}(m+1)^2=\\
&(-1)\sum_{k=1}^m(-1)^{m-k}k^2+(m+1)^2=\\
&(-1)\cdot \frac{m\cdot(m+1)}{2}+(m+1)^2=\\
&(m+1)(m+1-\frac m2)=\\
&\frac{(m+1)\cdot (m+2)}{2}. \qquad \checkmark \end{align}$$
Note: There is a deleted answer (visible for users with $10,000+$ rep), where there was a sign mistake.
