# Reconstruct equation by given solution

How can I reconstruct equation, which solution is given by series $\frac{x^{x-2}}{x!}$? The reverse task is straightforward with Solve function.

It seems pretty close to Lambert W function, but not exactly it.

• Do you mean that you want the generating function of $\frac{k^{k-2}}{k!}$? If so: Exp[-ProductLog[-x]] (1 + ProductLog[-x]/2). – J. M. will be back soon Nov 7 '17 at 21:31
• @J.M., thanks, it is. Can you please specify how you received it? I tried GeneratingFunction[n^(n - 2)/n!, n, x], but it failed with "Infinite expression 1/0 encountered". – Hasek Nov 8 '17 at 19:43
• I had to derive that result semi-manually since Mathematica does not know about the series expansion for powers of $W(x)/x$. – J. M. will be back soon Nov 9 '17 at 1:23