login
A282040
Let p = n-th prime == 7 mod 8; a(n) = sum of quadratic residues mod p that are > p/2.
5
4, 59, 126, 285, 679, 953, 1706, 2675, 3709, 4269, 5551, 6480, 8488, 8858, 11194, 12212, 15103, 20665, 23511, 24153, 30197, 32733, 38458, 36913, 42643, 42032, 59638, 64987, 70396, 70887, 85606, 94192, 95522, 99930, 123090, 117932, 130367, 134436, 141262, 149395, 169769, 167663, 175469
OFFSET
1,1
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:=[];
for i1 from 1 to 300 do
p:=ithprime(i1);
if (p mod 8) = 7 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];
fi;
od:
Ql; Qu; Q; Nl; Nu; N; # A282039, A282040, A282041, A282039 again, A282042, A282043
MATHEMATICA
sum[p_]:= Total[If[#>p/2 && JacobiSymbol[#, p] == 1, #, 0]& /@ Range[p-1]];
sum /@ Select[Range[7, 1000, 8], PrimeQ] (* Jean-François Alcover, Aug 31 2018 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
N. J. A. Sloane, Feb 20 2017
STATUS
approved