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.

A282036 a(n) is the sum of quadratic nonresidues of A002145(n) (the n-th prime == 3 mod 4).

This page as a plain text file.
%I A282036 #22 Nov 09 2020 21:33:48
%S A282036 2,14,33,95,161,279,473,658,944,1139,1491,1738,1826,2884,2996,4318,
%T A282036 4585,5004,6191,6683,7849,8413,10314,10746,11394,13157,13393,16013,
%U A282036 16566,18936,19783,20376,23946,27057,27804,30883,35541,35232,36384,39832,45671,50858,51363,50059,55097,56040
%N A282036 a(n) is the sum of quadratic nonresidues of A002145(n) (the n-th prime == 3 mod 4).
%H A282036 Robert Israel, <a href="/A282036/b282036.txt">Table of n, a(n) for n = 1..10000</a>
%H A282036 Christian Aebi, Grant Cairns, <a href="http://arxiv.org/abs/1512.00896">Sums of Quadratic residues and nonresidues</a>, arXiv:1512.00896 [math.NT], 2015.
%F A282036 a(n) = Sum_{k=1..(A002145(n)-1)/2} (-k^2) mod A002145(n). - _J. M. Bergot_ and _Robert Israel_, Nov 09 2020
%p A282036 with(numtheory):
%p A282036 a:=[]; m:=[]; d:=[];
%p A282036 for i1 from 1 to 200 do
%p A282036 p:=ithprime(i1);
%p A282036 if (p mod 4) = 3 then
%p A282036 sp:=0; sm:=0;
%p A282036 for j from 1 to p-1 do
%p A282036 if legendre(j,p)=1 then sp:=sp+j; else sm:=sm+j; fi; od;
%p A282036 a:=[op(a),sp]; m:=[op(m),sm]; d:=[op(d),sm-sp];
%p A282036 fi;
%p A282036 od:
%p A282036 a; m; d; # A282035, A282036, A282037
%p A282036 # Alternative:
%p A282036 f:= p -> add(-k^2 mod p, k=1..(p-1)/2)::
%p A282036 map(f, select(isprime, [seq(p,p=3..1000,4)])); # _Robert Israel_, Nov 09 2020
%t A282036 f[p_] := Total[Range[p-1] ~Complement~ Table[Mod[k^2, p], {k, (p-1)/2}] ]; f /@ Select[Range[3, 1000, 4], PrimeQ] (* _Jean-François Alcover_, Feb 16 2018, after _Robert Israel_ *)
%o A282036 (PARI) lista(nn) = forprime(p=2, nn, if(p%4==3, print1(sum(k=1, p-1, if (!issquare(Mod(k, p)), k)), ", "))); \\ _Michel Marcus_, Nov 09 2020
%Y A282036 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.
%Y A282036 Cf. A002145.
%K A282036 nonn
%O A282036 1,1
%A A282036 _N. J. A. Sloane_, Feb 20 2017