\[G\left(n,\chi\right)=\sum_{m=1}^{k}\chi\left(m\right)e^{2\pi\mathrm{i}mn/k}.\]