login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

(Sum of the quadratic nonresidues of prime(n)) / prime(n).
2

%I #20 Feb 13 2024 11:33:49

%S 1,2,3,3,4,5,7,7,9,9,10,11,14,13,16,15,17,21,18,22,22,22,24,25,28,28,

%T 27,28,34,35,34,36,37,41,39,41,47,43,47,45,54,48,49,54,54,59,59,57,58,

%U 67,60,66,64,72,67,73,69,70,72,73,78,87,78,79,84,84,89,87,88,99,96,93,96

%N (Sum of the quadratic nonresidues of prime(n)) / prime(n).

%C Always an integer for primes >= 5.

%D D. M. Burton, Elementary Number Theory, McGraw-Hill, Sixth Edition (2007), p. 185.

%H Nick Hobson, <a href="/A125616/b125616.txt">Table of n, a(n) for n = 3..1000</a>

%F a(n) = A125615(n)/prime(n).

%F If prime(n) = 4k+1 then a(n) = k = A076410(n).

%e The quadratic nonresidues of 7=prime(4) are 3, 5 and 6. Hence a(4) = (3+5+6)/7 = 2.

%p a:= proc(n) local p;

%p p:= ithprime(n);

%p convert(select(t->numtheory:-legendre(t,p)=-1, [$1..p-1]),`+`)/p;

%p end proc:

%p seq(a(n),n=3..100); # _Robert Israel_, May 10 2015

%t Table[Total[Flatten[Position[Table[JacobiSymbol[a, p], {a, p - 1}], -1]]]/ p, {p, Prime[Range[3, 100]]}] (* _Geoffrey Critzer_, May 10 2015 *)

%o (PARI) vector(73, m, p=prime(m+2); t=1; for(i=2, (p-1)/2, t+=((i^2)%p)); (p-1)/2-t/p)

%Y Cf. A002143, A076409, A076410, A125613-A125618.

%K easy,nonn

%O 3,2

%A _Nick Hobson_, Nov 30 2006