# Writing a Gauss sum as a sum over divisors

Let $\chi$ be a Dirichlet character modulo $q$ induced by a primitive character $\chi^*$ modulo $d$ for some divisor $d$ of $q$. Let $n$ be a positive integer, and consider the generalised Gauss sum $c_{\chi}(n) = \sum_{a \pmod{q}} \chi(a) e\left(\frac{an}{q}\right).$ Note that I do not assume that $(n,q) = 1$. When $n = 1$, this is just the usual Gauss sum $\tau(\chi)$.

In Multiplicative Number Theory by Montgomery and Vaughan, it is shown (Theorem 9.12) that $c_{\chi}(n) = \overline{\chi}^* \left(\frac{n}{(q,n)}\right) \chi^* \left(\frac{q}{d(q,n)}\right) \mu\left(\frac{q}{d(q,n)}\right) \frac{\varphi(q)}{\varphi\left(\frac{q}{(q,n)}\right)} \tau(\chi^*)$ if $d \mid \frac{q}{(q,n)}$, while $c_{\chi}(n) = 0$ otherwise.

Is it true that $c_{\chi}(n) = \tau(\chi^*) \sum_{c \mid \left(\frac{q}{d},n\right)} c \overline{\chi}^* \left(\frac{n}{c}\right) \chi^* \left(\frac{q}{cd}\right) \mu\left(\frac{q}{cd}\right) ?$ If not, is there some other way to write $c_{\chi}(n)$ as a sum over divisors?

In the simplest case when $d = 1$, so that $\chi^*$ is the trivial character, this states that $c_{\chi}(n) = \sum_{c \mid (q,n)} c \mu\left(\frac{q}{c}\right) = \mu\left(\frac{q}{(q,n)}\right) \frac{\varphi(q)}{\varphi\left(\frac{q}{(q,n)}\right)},$ which is Theorem 4.1 of Montgomery and Vaughan.