title: Most effecient way to count number of 1's from a certain offset
body: <p>If I have a given integer say 584,091,081 what is the most efficient way to count the number of ones from a given offset say n.</p>
  
  <p>So for the example number given the offset = 6 the first  couple of bits are 11001001.</p>
  
  <p>So I would want the answer 0. Because after the 6 bit comes a 1. </p>
  
  <p>If however we saw 100001001 then the expected answer would be 2 because there are 2 zeroes before the next one.</p>