Calculated the exponent of x^n