TITLE: Maclaurin Expansion for $e^{e^{z}}$ at $z=0$
QUESTION [5 upvotes]: I need to find terms up to degree $5$ of $e^{e^{z}}$ at $z=0$.  
I tried letting $\omega = e^{z} \approx 1+z+\frac{z^{2}}{2!}+\frac{z^{3}}{3!}+\cdots$, and then substituting these first few terms into the Taylor series expansion for $e^{z}$ as follows:

$e^{\omega} = \sum_{n=0}^{\infty}\frac{\omega^{n}}{n!} = 1 + \omega + \frac{\omega^{2}}{2!}+\frac{\omega^{3}}{3!}+\cdots = 1 + (1+z+\frac{z^{2}}{2!}+\frac{z^{3}}{3!}+\frac{z^{4}}{4!}+\cdots) + \frac{1}{2}\left(1+z+\frac{z^{2}}{2!}+\frac{z^{3}}{3!}+\frac{z^{4}}{4!}+\cdots \right)^{2}+ \frac{1}{3!}\left( 1+z+\frac{z^{2}}{2!}+\frac{z^{3}}{3!}+\frac{z^{4}}{4!}+\cdots\right)^{3}+\cdots$

But, then when I try to multiply this all out (using Maple), I find that going even further out than I have here, the terms of degree $\leq 5$ do not terminate. So, then I tried putting the command into Maple, and it came out to be something long and horrible with $e$ coefficients for each term.
I must be missing something here.
Could somebody please tell me how to finish this problem? I would ask for a complete solution, not hints or leading questions. I've been working on this for hours and am beyond frustrated. The most edifying thing for me at this point would be to see the correct, full way it's supposed to be done, work backwards, take it apart, and then be able to apply it to other situations.
Thank you.

REPLY [0 votes]: $$f(z)=e^{e^z}$$
Taylor series at $z_0=0$:
$$f(z)=\sum_{n=0}^\infty\frac{f^{(n)}(z)|_0}{n!}z^n$$
You can use the higher chain rule (Faà di Bruno's formula).
$S(n,k)$ are the Stirling numbers of the second kind, $B_n$ is the $n$-th Bell number.
$$f(z)^{(n)}=\sum_{k=0}^ne^{kz}S(n,k)e^{e^z}$$
$$f(z)^{(n)}|_0=\sum_{k=0}^nS(n,k)e=e\sum_{k=0}^nS(n,k)=eB_n$$
$$f(z)=\sum_{n=0}^\infty\frac{eB_n}{n!}x^n$$
$$f(z)=e+ez+ez^2+\frac{5}{6}ez^3+\frac{5}{8}ez^4+\frac{13}{30}ez^5+...$$
{"set_name": "stack_exchange", "score": 5, "question_id": 1743491}