For $n$ a natural integer congruent to $7$ modulo $8$, one has seemingly always
$$\sum\_{k=1}^{(n-1)/2}\left(\frac{k}{n}\right)k=0$$
where $\left(\frac{k}{n}\right)$ denotes the Jacobi symbol.


First cases:


$n=7$: $1+2-3$


$n=15$: $1+2+4-7$


$n=23$: $1+2+3+4-5+6-7+8+9-10-11$


I do not see any reason for this. Did I miss something obvious?



A curious sum for integers $\equiv 7\pmod 8$.
There are probably lots of ways to see this, but here's one: let $S\_1$ be the sum above, and let $$S\_2 = \sum\_{k=(n+1)/2}^{n-1} k \left( \frac{k}{n} \right).$$ Then $$S\_1 + S\_2 = S = \sum\_{k=1}^{n-1} k \left( \frac{k}{n} \right).$$ Now you can rewrite $S$ (since $x \to 2x$ is a bijection mod $n$) as $$S = \sum\_{k=1}^{(n-1)/2} 2k \left( \frac{2k}{n} \right) + \sum\_{k=(n+1)/2}^{n-1} (2k-n) \left( \frac{2k}{n} \right) = 2S - n \sum\_{k=(n+1)/2}^{n-1} \left( \frac{k}{n} \right), $$ where we used $(2/n) = 1$. Finally, we have $$S = 2S + n \sum\_{k=1}^{(n-1)/2} \left( \frac{k}{n} \right),$$ by changing $k$ to $n-k$ in the summation and using $(-1/n) = -1$. So $S = -n\sum\_{k=1}^{(n-1)/2} \left( \frac{k}{n} \right)$.


On the other hand, we can switch the index in $S\_2$ from $k$ to $n-k$ as well, to get 
$$S\_2 = \sum\_{k=1}^{(n-1)/2} (n-k) \left( \frac{n-k}{n}\right) = -n \sum\_{k=1}^{(n-1)/2} \left( \frac{k}{n} \right) + \sum\_{k=1}^{(n-1)/2} k \left( \frac{k}{n} \right) = S + S\_1 = 2S\_1 + S\_2.$$
(We used $(-1/n) = -1$ again).


Therefore $S\_1 = 0.$


