Hi,

I'm trying to create a formula for the function $g^n(x)$ which has the following derivative pattern:

$$g^1(x) = \frac{e^x(x-1) + 1}{x^2}$$

$$g^2(x) = \frac{e^x(x^2 - 2x + 2) - 2}{x^4}$$

$$g^3(x) = \frac{e^x(x^3 - 3x^2 + 6x - 6) + 6}{x^4}$$

$$g^4(x) = \frac{e^x(x^4 - 4x^3 +12x^2 -24x + 24) - 24}{x^5}$$

$$g^5(x) = \frac{e^x(x^5 - 5x^4 + 20x^3 - 60x^2 +120x - 120) + 120}{x^6}$$

etc.

What I have so far is $$g^n(x) = \frac{e^x(x^n - [SUMMATION HERE])}{x^{n+1}}$$

I can't seem to figure out what sort of summation is required for the expression inside the brackets that says SUMMATION HERE. Help would be very much appreciated!