I'm trying to evaluate
$$ \sum_{m'}\exp(-i\pi(m'+\alpha)/M) $$
where $\alpha=0,1,\dots,2M$. There are two questions. The first is the claim is that if $M$ is even and
$$ \sum_{m'=1}^M\exp(-i\pi(m'+\alpha)/M) = \sqrt{M}e^{-i\pi/4}. $$
First, I don't understand how to get rid of $\alpha$. If I do the numerics, this integer doesn't appear to play any role, but I don't understand why because if I set $m=m'+\alpha$ the sum gets shifted and one gets an extra term.
The second is, if $M$ is instead odd and $N=(M-1)/2$ how does one evaluate
$$ \sum_{m'=-N}^N\exp(-i\pi(m'+\alpha)/M) = \;?. $$
I feel that one can use either this question or the second formula in exercise 43, Chapt. 10 from Askey but I can't see how.