get second rightmost 0 bit as int
function secondRightmostZeroBit($n) { return ~($n | ($n+1)) & (($n | ($n+1))+1); }