login
A282723
Let p = n-th prime == 3 mod 8; a(n) = sum of quadratic residues mod p.
2
1, 22, 76, 430, 767, 1072, 1577, 2675, 3930, 4587, 6520, 7518, 10761, 12258, 14809, 19527, 23025, 26811, 29148, 35247, 41900, 47844, 52771, 57938, 61377, 66944, 73845, 76568, 79940, 83941, 94088, 102237, 104781, 114744, 117470, 134498, 152678, 161389, 167881, 181249, 193377, 204075, 221598, 228185
OFFSET
1,2
LINKS
Aebi, Christian, and Grant Cairns. Sums of Quadratic residues and nonresidues, arXiv preprint arXiv:1512.00896 (2015).
MAPLE
with(numtheory):
Ql:=[]; Qu:=[]; Q:=[]; Nl:=[]; Nu:=[]; N:=[]; Th:=[];
for i1 from 1 to 300 do
p:=ithprime(i1);
if (p mod 8) = 3 then
ql:=0; qu:=0; q:=0; nl:=0; nu:=0; n:=0;
for j from 1 to p-1 do
if legendre(j, p)=1 then
q:=q+j;
if j<p/2 then ql:=ql+j; else qu:=qu+j; fi;
else
n:=n+j;
if j<p/2 then nl:=nl+j; else nu:=nu+j; fi;
fi;
od;
Ql:=[op(Ql), ql];
Qu:=[op(Qu), qu];
Q:=[op(Q), q];
Nl:=[op(Nl), nl];
Nu:=[op(Nu), nu];
N:=[op(N), n];
Th:=[op(Th), q+ql];
fi;
od:
Ql; Qu; Q; Nl; Nu; N; Th; # A282721 - A282727
MATHEMATICA
Table[Table[Mod[a^2, p], {a, 1, (p-1)/2}]//Total, {p, Select[Prime[Range[100]], Mod[#, 8] == 3 &]}] (* Vincenzo Librandi, Feb 21 2017 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
N. J. A. Sloane, Feb 20 2017
STATUS
approved