# Let p be an odd prime number and let n be a quadratic nonresidue modulo p. Prove that

$$\sum_{\substack{d\mid n\\d>0}} d^{\frac{p-1}{2}}\equiv0\pmod{p}$$

I've tried using the fact that the sum divides evenly into p to prove it directly. But I just can't seem to figure out a concrete proof.

-

Change the sum to Euler Product form: $$\sum_{d\mid n} d^{\frac{p-1}{2}}=\prod_{\substack{q\mid n\\q\in\mathbb{P}}} (1+q^{\frac{p-1}{2}})$$

By Euler's Criterion, If $q$ is a QNR, $q^{\frac{p-1}{2}}\equiv-1\pmod{p}$. Since $n$ is a QNR and quadratic character is multiplicative, there must be at least one such $q$.
$$\Rightarrow \sum_{d\mid n} d^{\frac{p-1}{2}}=0$$

-

Since $n$ is not a perfect square, the divisors of $n$ can be divided into pairs $\{a,b\}$, where $ab=n$.

Note that $ab=n$ implies that one of $a$ and $b$ is a QR, and the other is an NR. (The product of two QR is a QR, as is the product of two NR.)

If follows that one of $a^{(p-1)/2}$ or $b^{(p-1)/2}$ is congruent to $1$ modulo $p$, and the other is congruent to $-1$. So their sum is congruent to $0$ modulo $p$.

-