login
The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A282038 (Sum of the quadratic nonresidues of prime(n)) - (sum of the quadratic residues of prime(n)). 7
-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 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,4

COMMENTS

Equals 0 if p == 1 mod 4.

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).

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 *)

PROG

(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

CROSSREFS

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.

Sequence in context: A123797 A123805 A124200 * A133346 A091920 A036934

Adjacent sequences:  A282035 A282036 A282037 * A282039 A282040 A282041

KEYWORD

sign

AUTHOR

N. J. A. Sloane, Feb 20 2017

STATUS

approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified May 31 22:45 EDT 2020. Contains 334756 sequences. (Running on oeis4.)