# Quadratic Gauss sum using $|Z|^2=Z \bar Z$

Given $$Z=\sum_{k=1}^{n-1}\omega^{k^2}$$ I'm asked to find $$|Z|^2$$, here's what I thought of: $$|Z|^2=Z \bar Z=\left( \sum_{k=1}^{n-1}\omega^{k^2} \right) \left( \sum_{k=1}^{n-1}\frac{1}{\omega^{k^2}} \right)=\sum_{j=0}^{n-1}\underset{k \ne j}{\sum_{k=0}^n}\omega^{k^2}=\sum_{j=0}^{n-1}\left( Z- \omega^{k^2} + 1\right)=nZ -Z +n$$ Of course $$\omega = e^{\frac{2\pi i}{n}}$$.

Is this correct ? It's worth noting that the problem directs me to use $$|Z|^2=Z \bar Z$$, I'm not sure if this question has been asked before but I certainly didn't find the existing ones helpful. Thanks in advance.

• This would be a lot easier if you had $Z=\sum_{k=0}^{n-1}\omega^{k^2}$. Are you sure you have the question stated correctly? – Lord Shark the Unknown Nov 3 '18 at 17:01