I often see identity
$$\sum_{k=0}^{n-1}e^{\tau ika/n} = \cases {n \quad \text{ if }n | a\\0\quad \text{ otherwise}}$$
in the context of generating functions. It allows to zero out all members of sequence, indexed by $a$, except every $n$-th one (n divides a). The textbooks seem to consider it so obvious that it does not need any proof. Is it right or there is one?
(Assuming that $\tau$ in your formula stands for $2 \pi$) this is an immediate consequence of the "well-known" formula for the (finite) geometric sum $$ \sum_{k=0}^{n-1} x^k = \cases {n \quad \quad \text{ if } x = 1\\ \frac{x^n-1}{x-1}\quad \text{ otherwise}} $$ applied to $x = e^{\tau ia/n}$. (Note that $x = 1$ exactly if $n$ divides $a$.)