Check if a 32-bit number is power of 3 or not.