Thanks Mika!
I did it using the sql server 2008 version of log. At first I was getting a type conversion error, but I ended up fixing it (somehow).
WHERE (LOG(ServiceMask) / LOG(2)) != CONVERT(int, (LOG(ServiceMask) / LOG(2)))
I found out the hard way that LOG really means LN here. So I converted to base 2.