[go: up one dir, main page]

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

%I #12 Apr 07 2017 12:58:22

%S 1,22,76,430,767,1072,1577,2675,3930,4587,6520,7518,10761,12258,14809,

%T 19527,23025,26811,29148,35247,41900,47844,52771,57938,61377,66944,

%U 73845,76568,79940,83941,94088,102237,104781,114744,117470,134498,152678,161389,167881,181249,193377,204075,221598,228185

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

%H Vincenzo Librandi, <a href="/A282723/b282723.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], {a, 1, (p-1)/2}]//Total, {p, Select[Prime[Range[100]], Mod[#, 8] == 3 &]}] (* _Vincenzo Librandi_, Feb 21 2017 *)

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

%K nonn

%O 1,2

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