Is there any function, f(x), that outputs whether a given integer is odd or even? For example, if x were 1237, the function would output 1; and if it were 80, it would output 2.
I know this is quite easy to accomplish in programming but when it comes to paper and pen math, I am having difficulties.
You can use $n-2\big\lfloor \frac{n}{2} \big\rfloor$, where $\lfloor n \rfloor$ is the floor function.
Also $\frac{1-(-1)^n}{2}$ and $\sin(\frac{\pi n}{2})$.