I am somehow dissatisfied with the explanations I've found for the following paradox:
$$\tag1 e^{1+2\pi in}=ee^{2\pi in}=e$$ raising both sides to $1+2\pi i$ we have $$\tag2 (e^{1+2\pi in})^{1+2\pi in}=e$$ then expanding the exponent $$\tag3 e^{1+4\pi in-4\pi^2n^2}=e$$
$$\tag4 e^1e^{4\pi in}e^{-4\pi^2n^2}=e$$
$$\tag5 e^{-4\pi^2n^2}=1$$ which is paradoxical as $e \neq 1$. As the Wikipedia article says, the problem is in passages 2 and 3, as the way in which a complex power is defined is $w^z=e^{z\log w}$ where the complex logarithm is multivalued, so $w^z$ is multivalued as well. But the reason why the passage 2, 3 is not justified is not made explicit, and I am trying to do that, rigorously, here.
Starting from point 2, we say that the formula $(e^{1+2\pi i})^{1+2\pi i}$ is in fact a multivalued expression that can be expressed as $$e^{(1+2\pi in)\log(e^{1+2\pi in})}=e^{(1+2\pi in)(1+2\pi in+2k\pi i)}$$ then the value $e^{1+4\pi in-4\pi^2n^2} \neq e$ is obtained when $k=0$, while $e$ is obtained with $k=-n$. So 2 and 3 are invalid because they assume different values of $k$. Is this correct?