# Relation that holds for the Legendre symbol of an integer but not for the Jacobi symbol?

Let $p$ be a prime number and $\big(\frac{a}{p} \big)$ the Legendre symbol.

Then we have the equality

$$\sum_{a=1}^{p-1} \big(\frac{a}{p} \big) \zeta^a =\sum_{t=0}^{p-1} \zeta^{t^2},$$ where $\zeta$ is a primitive $p$th root of unity.

This follows by the interpretation that $\big(\frac{a}{p} \big)$ is $1$ if $a$ is a square mod $p$ and $-1$ otherwise.

I am wondering if the similar equality holds when $p$ is not a prime number but an integer $n$. I know that the Jacobi symbol is a generalization of the Legendre symbol. But the interpretation as above doesn't hold in general.

So my questions are:

1. Does the following equality hold $$\sum_{a=1}^{n-1} \big(\frac{a}{n} \big) \zeta^a =\sum_{t=0}^{n-1} \zeta^{t^2},$$ where $\zeta$ is a primitive $n$ the root of unity and $\big(\frac{a}{n} \big)$ is the Jacobi symbol? (It seems that this does not hold for a general $n$. Is there any specific condition that this equality holds?)

2. If so, what is the condition on $n$ and how do I prove it?

3. If not, is there a similar function (character) $f$ satisfying the following equality $$\sum_{a=1}^{n-1} f(a) \zeta^a =\sum_{t=0}^{n-1} \zeta^{t^2} ?$$

-
@ThomasAndrews I calculated for $n=4$ and it seems the equality does not hold. – Snow Mar 9 '13 at 23:18

An accurate, though perhaps not terribly helpful, answer to (3) is, let $f(a)$ be the number of solutions to the congruence $$x^2\equiv a\pmod n$$ (although this works better if you let the sum on the left start at $a=0$). Now you can work on expressing $f(a)$ in terms of $\left({a\over p}\right)$ for primes $p$ dividing $n$.
I guess you mean: let $f(a)$ be the number of solutions to the congruence minus $1$. Then the equality will hold. – barto Dec 13 '13 at 22:00