implemented fast exponentiation function
see if the number can be expressed as a^b