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.
$$
Note that this sequence is periodic with period $4$. A similar procedure may be conducted with any periodic sequence. Index the sequence from $0$. Then the sequence is the solution of the recurrence relation
$$
a\_n=a\_{n-4};\quad (a\_0=1,a\_1=1,a\_2=-1,a\_3=-1)
$$
This recurrence relation has characteristic equation $r^4-1=0$ and thus roots $r=1,-1,i,-i$. (In general if the sequence has period $k$, then the roots of the characteristic equation will be the $k$ roots of unity). The solution then is
$$
a\_n=c\_0+c\_1(-1)^n+c\_2i^n+c\_3(-i)^n\quad (n\geq0)
$$ 
where the $c\_i$ are determined such that $a\_0=1,a\_1=1,a\_2=-1,a\_3=-1$. This corresponds to solving a system of equations.

The sequence may also be encoded as the coefficients of the generating function
$$
F(x)=\frac{1+x-x^2-x^3}{1-x^4}.
$$