Deriviation of the "Twiddle Sum" property I can't seem to understand how to derive the "twiddle sum" property:

$$\sum_{n=0}^{N-1}W_{N}^{kn}=N \ \delta[k\bmod N] $$ 
where $$ W_{N} \triangleq e^{\frac{j 2 \pi }{N}} $$
and $$ \delta[n] \triangleq  \begin{cases}
     1 &amp; \text{if } n=0 \\
     0 &amp; \text{otherwise}
     \end{cases}$$

I've tried doing the following:

$$\begin{align}
\sum_{n=0}^{N-1}W_{N}^{kn} &amp; = \sum_{n=0}^{N-1}e^{\frac{j 2 \pi k n}{N}} \\
 &amp; = \sum_{n=0}^{N-1} \left( e^{\frac{j 2 \pi k}{N}} \right)^n \\
 &amp; = \frac{1 - \left( e^{\frac{j 2 \pi k}{N}} \right)^N}{1 - e^{\frac{j 2 \pi k}{N}}} \\
 &amp; \\
 &amp; = \frac{1 - e^{j 2 \pi k}}{1-e^{\frac{j 2 \pi k}{N}}} \\
 &amp; \\
 &amp; = \begin{cases}
    ?? &amp; \text{if } k=mN \quad\quad m\in \mathbb{Z} \\
     0 &amp; \text{otherwise} \quad k \in \mathbb{Z}
     \end{cases} \\
\end{align} $$

It seems I'm missing an $N$ before the delta, have I done a mistake ?
The most straightforward way to see this is to note that for $k=mN$

$$W_N^{kn}=e^{j2\pi mnN/N}=e^{j2\pi mn}=1$$

So the sum for the case $k=mN$ is simply

$$\sum_{n=0}^{N-1}1=1+1+\ldots+1=N$$

Note that the solution using L'Hopital's rule is a bit dubious because for $k=mN$ the formula for the geometric series is not valid because the terms are all equal to one (note the $r\neq 1$ condition in the link above). So you arrive at an expression that is only valid for $k\neq mN$, and then you somehow massage it into a solution that also works for $k=mN$, but this is bad math, even for engineers.