I am trying to calculate the residue of $ze^{\frac{1}{z}}$, here's what I got:
We have a singularity at $z=0$.
We know that $e^w=\sum_{n=0}^\infty \frac{w^n}{n!}$ so $e^{\frac{1}{z}}=\sum_{n=0}^\infty \frac{(\frac{1}{z})^n}{n!}=\sum_{n=0}^\infty \frac{1}{n!z^n}=1+\frac{1}{z}+\frac{1}{2!z^2}+\frac{1}{3!z^3}+\frac{1}{4!z^4}+...$
so
$ze^{\frac{1}{z}}= z(1+\frac{1}{z}+\frac{1}{2!z^2}+\frac{1}{3!z^3}+\frac{1}{4!z^4}+...)=z+1+\frac{1}{2!z}+\frac{1}{3!z^2}+\frac{1}{4!z^3}+...$.
So $z=0$ is an essential singularity as we have no negative terms of $(z-z_0)=(z-0)=z$.
Now, I thought that the residue was given by the coefficient of $\frac{1}{z}$ which in this case would be $\frac{1}{2!}$. However, when I checked the answer was 1 and I have no idea why. Is my idea of what a residue in this case is flawed? I have watched a lot of videos and read up online but it seems to all support what I thought.
Thank you in advance!