Generating function for the factorial sequence As asked in the title, I am trying to arrive at the generating function 
$\displaystyle\sum_{k=0}^{\infty}k!x^k$ 
just by starting with the generating function with constant 1 sequence $f(x) = \displaystyle\sum_{k=0}^{\infty}x^k$ and using the operation of differentiating $f(x)$ and shifting the terms in the sequence by multiplying $f(x)$ by $x$.
My attempt of the problem (which I believe is wrong).
Start with the following:
$f(x) = \displaystyle\sum_{k=0}^{\infty}x^k$
We differentiating it $k$ times and get
$f^{(k)} = \displaystyle\sum_{k=0}^{\infty}k!x^0 = \displaystyle\sum_{k=0}^{\infty}k!$
Then we shift the terms in the sequence by multiplying $x^k$ to $f^{(k)}$ and we get
$x^kf^{(k)} = \displaystyle\sum_{k=0}^{\infty}k!x^k$. This I believe is wrong because if we look at the $k^{\mathrm{th}}$ partial sum of $f(x)$, then differentiating the $k^{\mathrm{th}}$ partial term $k$ times gives us $k!$ and multiplying this by $x^k$ gives us $k!x^k$, not $\displaystyle\sum_{k=0}^{k}k!x^k$. 
I understand the example of how to get from $f(x)$ to getting a generating function of sequence of squares or cubes by differentiating $f(x)$ and multiplying the result by $x$ and repeating this process once more. 
If anyone can give me a perspective of how to see this problem or maybe a misunderstanding on my part, I would appreciate it. 
 A: You should ask what it means to "arrive at the generation function". Since your series cannot be interpreted as one defining a analytic function $f(x)$ for $x$ in some neighbourhood of $0$ (for that the series would have to have a positive radius of convergence, which it doesn't), you should not expect to find an expression that describes such a function and which is somehow "equal" to your formal power series. It is a general fact that any formal power series in $x$ occurs as the Taylor series of some smooth real function of $x$, but the behaviour of such a function, which is far from unique, away from $x=0$ is entirely unrelated to your formal power series, so you won't find such an $f$ easily either.
What you can do is find a formal differential equation that is satisfied by your power series, and I think this is what your professor is asking for. Here is how you can do it: the coefficients $c_k=k!$ of your series, which I shall call $S$, clearly satisfy the recurrence $c_{k+1}=(k+1)c_k$ for all $k\in\mathbf N$. If you multiply a formal power series $\sum_{k\in\mathbf N}c_kx^k$ by $x$ and then differentiate, you get $\sum_{k\in\mathbf N}(k+1)c_kx^k$, and multiplying once more by $x$ gives $\sum_{k\in\mathbf N}(k+1)c_kx^{k+1}$. In the case of $S$, the result is almost identical to the original series, only the constant term $1$ has disappeared. So denoting by $D_x$ formal differentiation with respect to $x$, your series satisfies
$$
  S=1+xD_x(xS),
$$
or after some simple rewriting
$$
  (1-x)S=1+x^2D_x(S).
$$
For the reasons indicated above you should not expect this differential equation to have any solutions in the neighbourhood of $x=0$, and any solutions it has away from $0$ bear little relation to your series. But your series does satisfy the equation. Note that unlike the ordinary handling of differential equations, this one needs no "initial condition": the equation itself makes it clear that the constant term of $S$ is $1$. 
A: Euler considered the (alternate) series $$f(x)=1-1!x+2!x^2-3!x^3+\cdots$$ and used $\phi(x)=x\cdot f(x)$ and term-by-term differentiation to get $$x^2\phi'(x)+\phi(x)=x$$
Try to solve this ODE before consulting Hardy's derivation (and yes the series is divergent everywhere except at $0$).
Fine continuation! 
A: Well, formally
$$\begin{align}
f(x) &= \sum_{k=0}^\infty k!x^k
\\
x f(x) &= \sum_{k=0}^\infty k!x^{k+1} = \sum_{k=1}^\infty (k-1)! x^k
\\
\frac{d}{dx}\big(xf(x)\big) &= \sum_{k=!}^\infty (k-1)! k x^{k-1}
= \sum_{k=1}^\infty k!x^{k-1}
\\
1+x\frac{d}{dx}\big(xf(x)\big) &= \sum_{k=0}^\infty k!x^k = f(x)
\end{align}$$
so you get a differential equation for $f(x)$.  Despite its divergence everywhere.
A: Repeating my response to this post: 
More generally, Borel-regularized sums of these the (formal, initially) ordinary generating functions of any integer-valued multi-factorial function can be given in terms of the incomplete gamma function. See pages 9 and 10 of this article for specifics. The resulting generating functions in this case are highly non-elementary and can be a pain to work with. 
However, we can always define these generating functions formally and work with the generating function within the ring of formal power series. 
In particular, formal infinite Jacobi-type continued fractions for the generating function you requested can be defined (see this article by Flajolet for examples), and moreover, the rational $h^{th}$ convergents to these infinite continued fractions (which are always convergent functions of $z$) approximate the terms up to order $2h$. In the second article properties of a more general class of factorial functions are considered by generalizing Flajolet's result for the rising factorial function $r^{\bar{n}}$ specialized to particular values of $r = r(n)$ which then generates the single factorial function as a special case. The rational convergents to these generating functions are easy to work with and lead to new identities and expansions of $n!$ including exact formulas in terms of the special zeros of the (associated) Laguerre polynomials. 
