I was playing with numbers and suddenly i came up with the idea of wanting to make a equation f(x) where all x odd number domain will result of range 1, and all even number domain will result of range 0.

so:

if x = even, f(x) = 0

if x = odd, f(x) = 1

x can only be whole integers {...,-2,-1,0,1,2...}

y can only be 0 or 1

I want only one equation that give me such result. Please lend me a hand. I have been cracking my head all day and i always get it wrong.

Thanks.