find the first missing positive integer of a list in one pass
using a fast method to compute the power