I want to be able to evaluate wether the result of a function satisfies an expression. Is this possible to do?
Example
I have an expression, a linear polynomial: $$8x+4$$ for $x\in\mathbb{N}$
If I have, say a function: $$f(n)=\frac{3n}{2(-1)^k}$$ also $n\in\mathbb{N}$,
then when $n=4$ the numerator returns $12$ and the above expression is satisfied if $x=1$ for the numerator. $x$ can be any natural number for other results of course. Don't know if that made sense.
I need some variable to return true ($1$) or false ($0$) or $-1$ or $1$ to control some value when $8x+4 = 3n$. So that I can control some other function.
In other words when $3n$ does not result in the values of the sequence $\{4,12,20,28,36,...\}$ produced by $8x+4$, it returns $-1$ or otherwise $1$. I have used a variable $k$ for this. But how can I manipulate this function so that values in the first expression acts like an on/off switch? I don't want to use modulus.