[go: up one dir, main page]

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

%I #12 Apr 07 2017 13:16:17

%S 7,92,186,423,994,1343,2369,3683,5134,6012,7831,8955,11596,12428,

%T 15517,16802,21148,28720,31929,33321,41807,44778,51856,51253,57466,

%U 57845,82063,88015,95281,97050,117916,127225,130025,135180,165423,161927,176915,183609,193132,202180,228212,228056,236849

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

%H Vincenzo Librandi, <a href="/A282041/b282041.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:=[];

%p for i1 from 1 to 300 do

%p p:=ithprime(i1);

%p if (p mod 8) = 7 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 fi;

%p od:

%p Ql; Qu; Q; Nl; Nu; N; # A282039, A282040, A282041, A282039 again, A282042, A282043

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

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

%K nonn

%O 1,1

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