Snafuist, please explain exactly how negating the input and then computing the number of trailing zeroes would give the answer. Do you mean to say that a furthermodificationof the method of computing the number of trialing zeroes outlined on your webpage would give the answer? As far as I can tell, there is no requirement that the first 1 bit will only be followed by 1 bits, thus merely computing the number of trialing zeroes of the bitwise negated value is not guaranteed to give the correct answer.