Before compiling my code, I got stuck while generating a general formula. Can anyone help me get the general formula of the sequence below?
when n=3 the value is 0
when n=4 the value is 1
when n=5 the value is 0
when n=6 the value is -1
when n=7 the value is 0
when n=8 the value is 1
when n=9 the value is 0
when n=10 the value is-1
when n=11 the value is 0
when n=12 the value is 1
when n=13 the value is 0
when n=14 the value is -1 etc
I got part of the formula but I couldn't determine what exactly should go where my question marks (???) are,
|(-1)^n -1|/2 + (-1)^[n(???/2)]