# Showing $\sum_{b=0}^{N-1}\left(\frac{b}{p}\right)\zeta_M^{-kb} = 0$

I want to evaluate $$\sum_{b=0}^{N-1}\left(\frac{b}{p}\right)\zeta_M^{-kb}$$ for $p$ an odd prime, $p|N$, $M|N$, $(k,M)=1$. $\left(\frac{b}{p}\right)$ is the Legendre symbol. I'm fairly sure it should be zero, but I'm struggling to show this.

EDIT: I believe that we need $p\not | M$ too.

$$\sum_{b=0}^{N-1}\left(\frac{b}{p}\right)\zeta_M^{-kb} = \sum_{b=0}^{p-1}\left(\frac{b}{p}\right)\sum_{r=0}^{\frac{N}{p}-1}\zeta_M^{-k(b+rp)} = \sum_{b=0}^{p-1}\left(\frac{b}{p}\right)\zeta_M^{-kb}\sum_{r=0}^{\frac{N}{p}-1}\zeta_M^{-krp}$$
If $kp\equiv 0 (M)$ (therefore $p\equiv 0 (M)$ as $(M,k)=1$) then this simplifies to
$$\frac{N}{p}\sum_{b=0}^{p-1}\left(\frac{b}{p}\right)\zeta_M^{-kb}$$
If $kp\not\equiv 0 (M)$ then let $N=aM$
$$\sum_{r=0}^{\frac{N}{p}-1}\zeta_M^{-krp} = \sum_{r=0}^{\frac{N}{p}-1}\zeta_{\frac{N}{p}}^{-kra} = 0$$ as $ka \not \equiv 0 (\frac{N}{p})$ (because $p\not\equiv 0 (M)$).