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.

A282042 Let p = n-th prime == 7 mod 8; a(n) = sum of quadratic nonresidues mod p that are > p/2.

This page as a plain text file.
%I A282042 #20 Aug 31 2018 15:58:43
%S A282042 11,128,219,520,1176,1348,2221,3310,4766,6106,8034,8271,10049,12443,
%T A282042 14613,15193,21012,27486,26814,30664,39248,39318,41699,48888,46052,
%U A282042 52595,74613,72878,78599,85768,107895,103643,111125,111195,130497,145619,148490,160159,169503,166856,180406,194204
%N A282042 Let p = n-th prime == 7 mod 8; a(n) = sum of quadratic nonresidues mod p that are > p/2.
%H A282042 Robert Israel, <a href="/A282042/b282042.txt">Table of n, a(n) for n = 1..1000</a>
%H A282042 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 A282042 with(numtheory):
%p A282042 Ql:=[]; Qu:=[]; Q:=[]; Nl:=[]; Nu:=[]; N:=[];
%p A282042 for i1 from 1 to 300 do
%p A282042 p:=ithprime(i1);
%p A282042 if (p mod 8) = 7 then
%p A282042 ql:=0; qu:=0; q:=0; nl:=0; nu:=0; n:=0;
%p A282042 for j from 1 to p-1 do
%p A282042 if legendre(j,p)=1 then
%p A282042 q:=q+j;
%p A282042 if j<p/2 then ql:=ql+j; else qu:=qu+j; fi;
%p A282042 else
%p A282042 n:=n+j;
%p A282042 if j<p/2 then nl:=nl+j; else nu:=nu+j; fi;
%p A282042 fi;
%p A282042 od;
%p A282042 Ql:=[op(Ql),ql];
%p A282042 Qu:=[op(Qu),qu];
%p A282042 Q:=[op(Q),q];
%p A282042 Nl:=[op(Nl),nl];
%p A282042 Nu:=[op(Nu),nu];
%p A282042 N:=[op(N),n];
%p A282042 fi;
%p A282042 od:
%p A282042 Ql; Qu; Q; Nl; Nu; N; # A282039, A282040, A282041, A282039 again, A282042, A282043
%t A282042 sum[p_]:= Total[If[#>p/2 && JacobiSymbol[#, p] != 1, #, 0]& /@ Range[p-1]];
%t A282042 sum /@ Select[Range[7, 1000, 8], PrimeQ] (* _Jean-François Alcover_, Aug 31 2018 *)
%Y A282042 Cf. A282035-A282043 and A282721-A282727.
%K A282042 nonn
%O A282042 1,1
%A A282042 _N. J. A. Sloane_, Feb 20 2017