✔ 最佳答案
Gauss' Lemma states that (a/p) = (-1)^u, where u denotes the number of residues mod p (in the range 0 to p) in the set {1a, 2a, ..., (p-1)a/2} which are greater than p/2.
---------------------------------------------------------
Let p be an odd prime and note that u = the number of elements of the set {2*1, 2*2, 2*3, ..., 2*(p-1)/2} which exceed (p-1)/2. Let m be the index satisfying 2m <= (p-1)/2 and 2(m+1) > (p-1)/2.
Then, u = [(p-1)/2] - m.
If p = 8k + 1, then (p-1)/2 = 4k and m = 2k. Thus, u = 4k - 2k = 2k, which is even. By Gauss' Lemma, (2/p) = 1.
If p = 8k + 7, then (p-1)/2 = 4k + 3 and m = 2k + 1. Thus, u = 2k + 2 which is even. By Gauss' Lemma, (2/p) = 1.
If p = 8k + 3, then (p-1)/2 = 4k + 1 and m = 2k. Thus, u = 2k + 1 which is odd. By Gauss' Lemma, (2/p) = -1.
If p = 8k + 5, then (p-1)/2 = 4k + 2 and m = 2k + 1. Thus, u = 2k + 1, which is odd. By Gauss' Lemma, (2/p) = -1.
I hope that helps!