Assuming the input of x are integers only which start at $0$, find a formula for $f_j$ with $f_0 = 0$ when function $v$ which represents the distances between each point on $f$ is the following $v = -1,1,-1,1$. The book has been showing the relation ship of function $v$ and $f$ as function $v$ represents the slope of function $f$
I know that the formula for $v$ is $-1^j$ and I know the pattern of $f$ will be $0,-1,0,-1,0,-1$... but I am struggling to find a formula for $f$ that can produce this sequence.
$(-1)^n$ gives $1,-1,1,-1,\ldots$
$(-1)^n-1$ gives $0,-2,0,-2,\ldots$
$\dfrac{(-1)^n-1}2$ gives $0,-1,0,-1,\ldots$