Question: 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}$$

Answer: 
**Hint**. Try this
$$
(-1)^{\large \frac{n(n-1)}2},\qquad n=0,1,2,3,\cdots.
$$
A trig version using that sin, cos of $(\pi/2)n$ are $\pm 1$ of period $4$ is
$$a\_n=\sin \frac{\pi}{2}n - \cos \frac{\pi}{2}n.$$
[from the periodicity it only needs checking for $n=1,2,3,4.$]