I saw a mathematical expression in a Quantum Computation Textbook that states
$$\sum_{k\in\{0,r,2r,...,N-r\}} \exp\left(\frac{2\pi ikl}{N}\right) = \begin{cases} \sqrt{N/r} & \text{ if } l \text{ is an integer multiple of } N/r, \\\\0 &\text{ otherwise}\end{cases} $$
I know how to sum a geometric series but I can't see why this is the case. By setting $r=1$ and $l = pN$ for some integer $p$, I get the result to be $N$ instead of $\sqrt{N}$. Can someone explain?
Additionally $N$ is an integer multiple of $r$.
