Three Recursive solutions to find exponents