OFFSET
1,2
LINKS
Jean-François Alcover, Table of n, a(n) for n = 1..1000
Christian Aebi, Grant Cairns, Sums of Quadratic residues and nonresidues, arXiv:1512.00896 [math.NT], 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:
# 2nd program
A282722 := proc(n)
local p, ar;
p := A007520(n) ;
a := 0 ;
for r from (p+1)/2 to p do
if numtheory[legendre](r, p) = 1 then
a := a+r ;
end if;
end do:
a ;
end proc:
seq(A282722(n), n=1..10) ; # R. J. Mathar, Apr 07 2017
MATHEMATICA
b[1] = 3; b[n_] := b[n] = Module[{p}, p = NextPrime[b[n - 1]]; While[Mod[p, 8] != 3, p = NextPrime[p]]; p];
a[n_] := Module[{p, q, r}, p = b[n]; q = 0; For[r = (p + 1)/2, r <= p, r++, If[KroneckerSymbol[r, p] == 1, q = q + r]]; q];
Array[a, 45] (* Jean-François Alcover, Nov 27 2017, after R. J. Mathar *)
CROSSREFS
KEYWORD
nonn
AUTHOR
N. J. A. Sloane, Feb 20 2017
STATUS
approved