How to model a function which satisfies following condition:
$$ f(x) = \begin{cases} 1 & x \in 3,7,11,\ldots\\ -1 & x \in 1,5,9,\ldots \end{cases} $$
The first result can be generated using $4n+1$ and the second with $4n-1$ for $n \in \mathbb{N}$. Can this be modelled using one function?