How can I solve the equation below with a recurrence procedure?
Show, with the help of reasoning by recurrence, the following equality $$\sum_{k=1}^{n}(-1)^k \cdot k^2=(-1)^{n} \cdot \sum_{k=1}^{n}k$$
How can I solve the equation below with a recurrence procedure?
Show, with the help of reasoning by recurrence, the following equality $$\sum_{k=1}^{n}(-1)^k \cdot k^2=(-1)^{n} \cdot \sum_{k=1}^{n}k$$
On
The equality is true for $n=1$.
Assuming it's true for $n=N$, that is
$$\sum_{k=1}^{N} (-1)^{k}k^{2}=(-1)^{N} \sum_{k=1}^{N} k$$
For $n=N+1$,
\begin{align*} \sum_{k=1}^{N+1} (-1)^{k} k^{2} &= \sum_{k=1}^{N} (-1)^{k}k^{2}+(-1)^{N+1}(N+1)^{2} \\ &= (-1)^{N} \sum_{k=1}^{N} k+(-1)^{N+1}(N+1)^{2} \\ &= (-1)^{N}\frac{N(N+1)}{2}+(-1)^{N+1}(N+1)^{2} \\ &= (-1)^{N+1} (N+1)\left( N+1-\frac{N}{2} \right) \\ &= (-1)^{N+1} \frac{(N+1)(N+2)}{2} \\ &= (-1)^{N+1} \sum_{k=1}^{N+1} k \end{align*}
It's also true for $n=N+1$.
By induction on $n$, the equality holds $\forall n\in \mathbb{N}$
Hint: What is the difference between two consecutive squares?