OFFSET
3,2
COMMENTS
Always an integer for primes >= 5.
REFERENCES
D. M. Burton, Elementary Number Theory, McGraw-Hill, Sixth Edition (2007), p. 185.
LINKS
Nick Hobson, Table of n, a(n) for n = 3..1000
EXAMPLE
The quadratic nonresidues of 7=prime(4) are 3, 5 and 6. Hence a(4) = (3+5+6)/7 = 2.
MAPLE
a:= proc(n) local p;
p:= ithprime(n);
convert(select(t->numtheory:-legendre(t, p)=-1, [$1..p-1]), `+`)/p;
end proc:
seq(a(n), n=3..100); # Robert Israel, May 10 2015
MATHEMATICA
Table[Total[Flatten[Position[Table[JacobiSymbol[a, p], {a, p - 1}], -1]]]/ p, {p, Prime[Range[3, 100]]}] (* Geoffrey Critzer, May 10 2015 *)
PROG
(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)
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Nick Hobson, Nov 30 2006
STATUS
approved