By relative prime factor theorem $$R = (Zm,+,.)$$ where R is the ring structure the input is $e_0 = 0$ and $e_1=1$ output is $$S_0 = { k : \gcd(m,k)>1 }$$ $$S_1 = { k : \gcd(m,k) = 1}$$
Now consider an example ie Z15 For Z mod 15 $$S_0 = {0,3,5,6,9,10,12}$$ $$S_1 = {1,2,4,7,8,11,13,14}$$
what will be the polynomial which defines S1?