Compute integer powers of 2