This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A282038 #23 Mar 23 2024 17:32:11 %S A282038 -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, %T A282038 515,321,0,0,635,655,0,417,0,1057,0,163,1837,0,895,0,2483,0,0,1791, %U A282038 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 %N A282038 (Sum of the quadratic nonresidues of prime(n)) - (sum of the quadratic residues of prime(n)). %C A282038 Equals 0 if p == 1 (mod 4). %H A282038 Rémy Sigrist, <a href="/A282038/b282038.txt">Table of n, a(n) for n = 1..10000</a> %H A282038 Christian Aebi and Grant Cairns, <a href="http://arxiv.org/abs/1512.00896">Sums of Quadratic residues and nonresidues</a>, arXiv preprint arXiv:1512.00896 [math.NT] (2015). %p A282038 with(numtheory): %p A282038 a:=[]; m:=[]; d:=[]; %p A282038 for i1 from 1 to 100 do %p A282038 p:=ithprime(i1); %p A282038 sp:=0; sm:=0; %p A282038 for j from 1 to p-1 do %p A282038 if legendre(j,p)=1 then sp:=sp+j; else sm:=sm+j; fi; od; %p A282038 a:=[op(a),sp]; m:=[op(m),sm]; d:=[op(d),sm-sp]; %p A282038 od: %p A282038 a; m; d; # A076409, A125615, A282038 %t A282038 sum[p_] := Total[If[JacobiSymbol[#, p] == 1, -#, #]& /@ Range[p-1]]; %t A282038 a[n_] := sum[Prime[n]]; %t A282038 Array[a, 100] (* _Jean-François Alcover_, Aug 31 2018 *) %o A282038 (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 %Y A282038 Sums of residues, nonresidues, and their differences, for p == 1 (mod 4), p == 3 (mod 4), and all p: A171555; A282035, A282036, A282037; A076409, A125615, A282038. %K A282038 sign %O A282038 1,4 %A A282038 _N. J. A. Sloane_, Feb 20 2017