I am trying to understand the Complex Fourier series solution for the following function, as printed on "Fundamentals of Electric Circuits" by Alexander & Sadiku:

The solution printed on the solutions manual is:

Please note the highlighted functions inside the red squares.
Take for example the identity inside the first red square (the one on the left). I was under the impression that $e^{jn\pi/2}$ was equal to $jsin(n\pi/2)$ only when 'n' is odd, meaning that:
\begin{array}{l l} cos(n\pi/2) & \quad \text{if $n$ is even}\\ jsin(n\pi/2) & \quad \text{if $n$ is odd} \end{array}
Or in other words: \begin{array}{l l} (-1)^{n/2} & \quad \text{if $n$ is even}\\ j(-1)^{(n-1)/2} & \quad \text{if $n$ is odd} \end{array}
Is any scenario possible in which the identities inside the red squares are true for any n, regardless if n is odd or even?
Eulers' identity is $$e^{ix} = \cos x + i\sin x$$ Where I use $i$ for the imaginary unit and $x\in\mathbb R$. This gives $$e^{\pm i \pi \frac n2} = \cos ( \pm \pi \frac n2 ) + i \sin (\pm \pi \frac n2) = \cos(\pi \frac n2) \pm i \sin (\pi \frac n2)$$ By axial symmetry of $\cos$ and point symmetry of $\sin$. Your "thought" isn't quite correct, $$e^{i\pi \frac n2} = (e^{i\frac \pi 2})^n = i^n = \cases{i & $n\equiv 1 \mod 4$ \\ -1 & $n\equiv 2 \mod 4$ \\ -i & $n\equiv 3 \mod 4$ \\ 1 & $n\equiv 0 \mod 4$}$$ This means your values are correct for the expression $e^{i\pi \frac n4}$