powx-n, divide and conquer