login
Let p = n-th prime == 3 mod 8; a(n) = sum of quadratic nonresidues mod p .
2

%I #13 Nov 05 2020 13:48:05

%S 2,33,95,473,944,1139,1826,2996,4585,5004,6683,8413,11394,13393,16566,

%T 20376,23946,27804,30883,36384,45671,50059,56040,62357,62874,69559,

%U 75486,81635,82795,88050,97183,104166,112030,118159,120925,138193,156613,167066,173670,187262,196026,206796,226333,242750

%N Let p = n-th prime == 3 mod 8; a(n) = sum of quadratic nonresidues mod p .

%H Vincenzo Librandi, <a href="/A282726/b282726.txt">Table of n, a(n) for n = 1..2500</a>

%H Aebi, Christian, and Grant Cairns. <a href="http://arxiv.org/abs/1512.00896">Sums of Quadratic residues and nonresidues</a>, arXiv preprint arXiv:1512.00896 (2015).

%p with(numtheory):

%p Ql:=[]; Qu:=[]; Q:=[]; Nl:=[]; Nu:=[]; N:=[]; Th:=[];

%p for i1 from 1 to 300 do

%p p:=ithprime(i1);

%p if (p mod 8) = 3 then

%p ql:=0; qu:=0; q:=0; nl:=0; nu:=0; n:=0;

%p for j from 1 to p-1 do

%p if legendre(j,p)=1 then

%p q:=q+j;

%p if j<p/2 then ql:=ql+j; else qu:=qu+j; fi;

%p else

%p n:=n+j;

%p if j<p/2 then nl:=nl+j; else nu:=nu+j; fi;

%p fi;

%p od;

%p Ql:=[op(Ql),ql];

%p Qu:=[op(Qu),qu];

%p Q:=[op(Q),q];

%p Nl:=[op(Nl),nl];

%p Nu:=[op(Nu),nu];

%p N:=[op(N),n];

%p Th:=[op(Th),q+ql];

%p fi;

%p od:

%p Ql; Qu; Q; Nl; Nu; N; Th; # A282721 - A282727

%t Table[Table[Mod[a^2, p/2], {a, 1, (p-1)}]//Total, {p, Select[Prime[ Range[ 200]], Mod[#, 8] == 3 &]}] (* _Vincenzo Librandi_, Feb 22 2017 *)

%Y Cf. A282035-A282043 and A282721-A282727.

%K nonn

%O 1,1

%A _N. J. A. Sloane_, Feb 20 2017