I need a function $f(n)$ that if $n$ is odd it returns $-1$, but if it is even it returns $1$. Is there a function like this? If so what is it? Also I would appreciate if it is not a trig function (Ahem $f(n) = \cos(n\pi)$).
2026-03-26 08:04:05.1774512245
What function would do this
47 Views Asked by Bumbble Comm https://math.techqa.club/user/bumbble-comm/detail At
3
What you have defined is already a function, but I assume what you want is an elementary expression for it. Try $$(-1)^{n}$$