Consider the following sequence, where the two consecutive terms are positive and the next two are negative, and so on:
$$ a_n = 1 , 1, -1 , -1 , 1 , 1 , -1 , -1 , 1 ...$$
I've managed to think up some way of writing the sequence:
$$a_n = (-1)^\left \lfloor{\frac{n}{2}}\right \rfloor$$
$$ a_n = \sqrt2 \cdot\frac{d^n}{dx^n} (\sin x) , \text{at }x=\frac{\pi}{4}$$
Are there other ways that this sequence be written as? I would imagine there is a way to write it implicitly but I can't think of it.
Edit: Also adding this ugly one I forgot to initially:
$$a_n=\begin{cases} 1 & \text{ if } n \text{ is divisible by 4};\\1 & \text{ if } n-1 \text{ is divisible by 4};\\-1 & \text{ if } n-2 \text{ is divisible by 4};\\-1 & \text{ if } n-3 \text{ is divisible by 4}\end{cases}$$
$$a_n=\begin{cases} 1 & \text{ if } n=4k+1 or \text{ } n= 4k+2;\\-1 & \text{ otherwise}\end{cases}$$