Exponent loop and recursive example