I have trouble understanding how to solve this question. I understand how when $n$ is $0$, the value is $0$, but do not understand how to calculate the value of $k$ based on this.
The first element of the sequence $a_1=0$, and if $n\geq 1$ then $a_{n+1} = a_n + (-1)^n\cdot n$. Find the value of $k$ if $a_k = 2013$.
Hint: You have for any $n\geq 1$ that $$a_n=\begin{cases}(n-1)/2&n\text{ odd}\\-n/2&n\text{ even}\end{cases}$$.
You can prove this by induction on $n$.
Edit: See below for a sketch of the proof:
As an induction base, let $n=1$, then $a_1=0$ and $(n-1)/2=0$.
For the induction step, let $a_n$ satisfy the formula for some $n$. we divide between the cases if $n$ is even or odd:
If $n$ is odd, then $a_n=(n-1)/2$ and $n+1$ is even. Now, $a_{n+1}=a_n+(-1)^n\cdot n$. By the induction hypothesis and as $n$ is odd, you have $a_{n+1}=(n-1)/2-n$, i.e. $a_{n+1}=n/2-1/2-n=-n/2-1/2=-(n+1)/2$.
If $n$ is even, you have $a_n=-n/2$ and $n+1$ is odd. Now, again $a_{n+1}=-n/2+n=n/2$ by the induction hypothesis and as $n$ is even. Now, $a_{n+1}=n/2=((n+1)-1)/2$.
Edit: Based on the suggestion of OP: To calculate the first few terms, we start with the given $a_1=0$. Then