is_odd(X) :- 1 is mod(X,2).
is_even(X) :- 0 is mod(X,2).