login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A282722 Let p = n-th prime == 3 mod 8; a(n) = sum of quadratic residues mod p that are > p/2. 2
0, 9, 44, 293, 461, 758, 1022, 1799, 2530, 3171, 4778, 5068, 7662, 8470, 9993, 14097, 16674, 19467, 20755, 25701, 29042, 34471, 37506, 40661, 45066, 48541, 54324, 54224, 58135, 60351, 68593, 75432, 74014, 83881, 85900, 98518, 112000, 117443, 122241, 132125, 143322, 151299, 163180, 161975, 181191 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,2
LINKS
Jean-François Alcover, Table of n, a(n) for n = 1..1000
Christian Aebi, Grant Cairns, Sums of Quadratic residues and nonresidues, arXiv:1512.00896 [math.NT], 2015.
MAPLE
with(numtheory):
Ql:=[]; Qu:=[]; Q:=[]; Nl:=[]; Nu:=[]; N:=[]; Th:=[];
for i1 from 1 to 300 do
p:=ithprime(i1);
if (p mod 8) = 3 then
ql:=0; qu:=0; q:=0; nl:=0; nu:=0; n:=0;
for j from 1 to p-1 do
if legendre(j, p)=1 then
q:=q+j;
if j<p/2 then ql:=ql+j; else qu:=qu+j; fi;
else
n:=n+j;
if j<p/2 then nl:=nl+j; else nu:=nu+j; fi;
fi;
od;
Ql:=[op(Ql), ql];
Qu:=[op(Qu), qu];
Q:=[op(Q), q];
Nl:=[op(Nl), nl];
Nu:=[op(Nu), nu];
N:=[op(N), n];
Th:=[op(Th), q+ql];
fi;
od:
Ql; Qu; Q; Nl; Nu; N; Th; # A282721 - A282727
# 2nd program
A282722 := proc(n)
local p, ar;
p := A007520(n) ;
a := 0 ;
for r from (p+1)/2 to p do
if numtheory[legendre](r, p) = 1 then
a := a+r ;
end if;
end do:
a ;
end proc:
seq(A282722(n), n=1..10) ; # R. J. Mathar, Apr 07 2017
MATHEMATICA
b[1] = 3; b[n_] := b[n] = Module[{p}, p = NextPrime[b[n - 1]]; While[Mod[p, 8] != 3, p = NextPrime[p]]; p];
a[n_] := Module[{p, q, r}, p = b[n]; q = 0; For[r = (p + 1)/2, r <= p, r++, If[KroneckerSymbol[r, p] == 1, q = q + r]]; q];
Array[a, 45] (* Jean-François Alcover, Nov 27 2017, after R. J. Mathar *)
CROSSREFS
Sequence in context: A228603 A297491 A104470 * A084016 A221508 A301397
KEYWORD
nonn
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 | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 24 18:17 EDT 2024. Contains 371962 sequences. (Running on oeis4.)