In C# I use to check the boolean gates like this
bool isValid= 3 & 1;
i.e whether 1 is contained in 3 or not. It comes true. as 3 has both the numbers 1 and 2 . My series continues as 2 raise to the power of n i.e 1, 2, 4, 8, 16, 32, 64, 128.. I need to check the same logic in SQL i.e I will pass the total and I need to check whether x number lies in it or not.