$x = 0$, $f(x) = 0$
$x = 1$, $f(x) = 1$
$x = 2$, $f(x) = 1$
$x = 3$, $f(x) = 1$
...
There have been so many times I could have used this at different programming problems but I always resorted to logical expressions. I feel that there should be a more elegant, purely mathematical, solution.