code: public static int maxbits(int[] i, int pos, int length) {
          int mask = 0;
          for (int k = pos; k < pos + length; ++k)
              mask |= i[k];
          return bits(mask);
      }
docs: Compute the maximum of the integer logarithms (ceil(log(x+1)) of a range
  of value
  
  @param i
  source array
  @param pos
  starting position
  @param length
  number of integers to consider
  @return integer logarithm