Are the following expression equivalent? I need to check wether this expressions are equal but I haven't yet learned enough about the floor function to tell (I also
$$ \frac 1 4 \left (5-\cos \left(n \frac \pi 2 \right)-2 (-1)^n \left(1+ \left \lfloor\frac 1 4 (-2+n) \right \rfloor - \left\lfloor \frac n 4 \right \rfloor \right)-\sin \left(n \frac \pi 2 \right)\right )$$
And
$$ \frac 5 4 - \frac 1 4 (-1)^n- \frac 1 2 \sin \left(n \frac \pi2 \right)$$
For all $n\in \Bbb{N}$.
 A: You need to think about what happens if $n$ is even, and then if $n$ is odd. For example, if $n$ is even, the second expression is clearly $1$, since $\sin\left(n\frac{\pi}{2}\right) = 0$. For the first expression, we get
$$\frac 1 4 \left (5-(\pm 1)-2\left(1+ \left \lfloor\frac 1 4 (-2+n) \right \rfloor - \left\lfloor \frac n 4 \right \rfloor \right)\right ),$$
where we have $+1$ if $n\equiv 0\mod{4}$ and $-1$ if $n\equiv 2\mod{4}$. But if $n\equiv 0\mod{4}$, then $\left \lfloor\frac 1 4 (-2+n) \right \rfloor - \left\lfloor \frac n 4 \right \rfloor = -1$, so we get $\frac{1}{4}(5-1) = 1$, while if $n\equiv 2\mod{4}$, then $\left \lfloor\frac 1 4 (-2+n) \right \rfloor - \left\lfloor \frac n 4 \right \rfloor = 0$ and we get $\frac{1}{4}(5+1-2) = 1$.
The analysis when $n$ is odd is presumably similar.
In general, when you are trying to analyze an expression like this involving the floor function, you are going to have to consider cases. The fact that you have trig functions whose arguments are multiples of $\frac{\pi}{2}$ should lead you even further in that direction.
