cp's OEIS Frontend

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.

A282724 Let p = n-th prime == 3 mod 8; a(n) = sum of quadratic nonresidues mod p that are < p/2.

This page as a plain text file.
%I A282724 #13 Nov 27 2017 11:35:24
%S A282724 0,2,13,94,129,247,306,555,745,999,1579,1555,2466,2653,3059,4581,5430,
%T A282724 6351,6658,8409,9087,11158,11996,12858,14814,15788,17880,17277,18950,
%U A282724 19481,22400,24876,23518,27448,28115,32285,36743,38269,39851,43111,47406,50055,53683,51645,58274,66410,65119,76013,80465
%N A282724 Let p = n-th prime == 3 mod 8; a(n) = sum of quadratic nonresidues mod p that are < p/2.
%H A282724 Jean-François Alcover, <a href="/A282724/b282724.txt">Table of n, a(n) for n = 1..1000</a>
%H A282724 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 A282724 with(numtheory):
%p A282724 Ql:=[]; Qu:=[]; Q:=[]; Nl:=[]; Nu:=[]; N:=[]; Th:=[];
%p A282724 for i1 from 1 to 300 do
%p A282724 p:=ithprime(i1);
%p A282724 if (p mod 8) = 3 then
%p A282724 ql:=0; qu:=0; q:=0; nl:=0; nu:=0; n:=0;
%p A282724 for j from 1 to p-1 do
%p A282724 if legendre(j,p)=1 then
%p A282724 q:=q+j;
%p A282724 if j<p/2 then ql:=ql+j; else qu:=qu+j; fi;
%p A282724 else
%p A282724 n:=n+j;
%p A282724 if j<p/2 then nl:=nl+j; else nu:=nu+j; fi;
%p A282724 fi;
%p A282724 od;
%p A282724 Ql:=[op(Ql),ql];
%p A282724 Qu:=[op(Qu),qu];
%p A282724 Q:=[op(Q),q];
%p A282724 Nl:=[op(Nl),nl];
%p A282724 Nu:=[op(Nu),nu];
%p A282724 N:=[op(N),n];
%p A282724 Th:=[op(Th),q+ql];
%p A282724 fi;
%p A282724 od:
%p A282724 Ql; Qu; Q; Nl; Nu; N; Th; # A282721 - A282727
%p A282724 # 2nd program
%p A282724 A282724 := proc(n)
%p A282724     local p,a,r;
%p A282724     p := A007520(n) ;
%p A282724     a := 0 ;
%p A282724     for r from 1 to (p-1)/2 do
%p A282724         if numtheory[legendre](r,p) <> 1 then
%p A282724             a := a+r ;
%p A282724         end if;
%p A282724     end do:
%p A282724     a ;
%p A282724 end proc:
%p A282724 seq(A282724(n),n=1..10) ; # _R. J. Mathar_, Apr 07 2017
%t A282724 b[1] = 3; b[n_] := b[n] = Module[{p}, p = NextPrime[b[n - 1]]; While[Mod[p, 8] != 3, p = NextPrime[p]]; p];
%t A282724 a[n_] := Module[{p, q, r}, p = b[n]; q = 0; For[r = 1, r <= (p - 1)/2, r++, If[KroneckerSymbol[r, p] != 1, q = q + r]]; q];
%t A282724 Array[a, 50] (* _Jean-François Alcover_, Nov 27 2017, after _R. J. Mathar_ *)
%Y A282724 Cf. A282035-A282043 and A282721-A282727.
%K A282724 nonn
%O A282724 1,2
%A A282724 _N. J. A. Sloane_, Feb 20 2017