A282038 (Sum of the quadratic nonresidues of prime(n)) - (sum of the quadratic residues of prime(n)).
-1, 1, 0, 7, 11, 0, 0, 19, 69, 0, 93, 0, 0, 43, 235, 0, 177, 0, 67, 497, 0, 395, 249, 0, 0, 0, 515, 321, 0, 0, 635, 655, 0, 417, 0, 1057, 0, 163, 1837, 0, 895, 0, 2483, 0, 0, 1791, 633, 1561, 1135, 0, 0, 3585, 0, 1757, 0, 3419, 0, 2981, 0, 0, 849, 0, 921, 5909, 0, 0, 993, 0, 1735, 0, 0, 6821, 3303, 0
Offset: 1
Keywords
Links
- Rémy Sigrist, Table of n, a(n) for n = 1..10000
- Christian Aebi and Grant Cairns, Sums of Quadratic residues and nonresidues, arXiv preprint arXiv:1512.00896 [math.NT] (2015).
Crossrefs
Programs
-
Maple
with(numtheory): a:=[]; m:=[]; d:=[]; for i1 from 1 to 100 do p:=ithprime(i1); sp:=0; sm:=0; for j from 1 to p-1 do if legendre(j,p)=1 then sp:=sp+j; else sm:=sm+j; fi; od; a:=[op(a),sp]; m:=[op(m),sm]; d:=[op(d),sm-sp]; od: a; m; d; # A076409, A125615, A282038
-
Mathematica
sum[p_] := Total[If[JacobiSymbol[#, p] == 1, -#, #]& /@ Range[p-1]]; a[n_] := sum[Prime[n]]; Array[a, 100] (* Jean-François Alcover, Aug 31 2018 *)
-
PARI
a(n) = my (p=prime(n)); return (sum(i=1, p-1, if (kronecker(i,p)==1, -i, +i))) \\ Rémy Sigrist, Apr 28 2017
Comments