Let $q > 3$ be a prime and $$ S_q := \sum_{k=1}^{q-1} \chi_{2,q} (k) \, k, $$ where $\chi_{2,q}$ is the real Dirichlet character modulo $q$ which is not the principal one.
I have to prove that $S_q$ is always divisible by $q$.
Let $q > 3$ be a prime and $$ S_q := \sum_{k=1}^{q-1} \chi_{2,q} (k) \, k, $$ where $\chi_{2,q}$ is the real Dirichlet character modulo $q$ which is not the principal one.
I have to prove that $S_q$ is always divisible by $q$.
On
Starter hint: $\chi$ acts as a group homomorphism $(\Bbb Z/q\Bbb Z)^\times\to\{\pm1\}$. The kernel is precisely those elements which are squares. (Thus, $\chi$ is the so-called Legendre symbol.) Try to convince yourself using your knowledge of cyclic groups! So $\chi_q(k)$ is $+1$ if $k$ is a square and is $-1$ if $k$ isn't. Rewrite the sum; see if you can identify simpler sums (which you can find closed-forms for) it can be expressed in terms of, while thinking of all summands and the sum itself as taking place in $\Bbb F_q$.
I am amenable to providing more hints if you need more help with the argument.
So if I'm right:
Let $w$ be a primitive root modulo $q$. Then every congruence class $1, 2, \dots, q-1$ is reached exactly once when we consider $w^0, w^1, \dots, w^{q-2}$ modulo $q$. So we can rewrite $S_q$ as following $$ S_q := \sum_{k=1}^{q-1} \chi_{2,q} (k) \, k = \sum_{k=1}^{q-1} w^k. \chi_{2,q} (w^k) $$ Since $$ \chi_{2,q} (w^k) = (-1)^k $$ we obtain $$ \sum_{k=1}^{q-1} w^k \chi_{2,q} (w^k) = \sum_{k=1}^{q-1} (-w)^k. $$ This is equal to $$ \frac{(-w)^{q-1} - 1}{-w-1} \equiv 0 \quad \mod q $$ by Fermat's Little Theorem. We observe that $-w \not\equiv 1$ since $q>3$.