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.

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

Original entry on oeis.org

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, 27, 28, 34, 35, 34, 36, 37, 41, 39, 41, 47, 43, 47, 45, 54, 48, 49, 54, 54, 59, 59, 57, 58, 67, 60, 66, 64, 72, 67, 73, 69, 70, 72, 73, 78, 87, 78, 79, 84, 84, 89, 87, 88, 99, 96, 93, 96
Offset: 3

Views

Author

Nick Hobson, Nov 30 2006

Keywords

Comments

Always an integer for primes >= 5.

Examples

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

References

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

Crossrefs

Programs

  • 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 *)
  • 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)

Formula

a(n) = A125615(n)/prime(n).
If prime(n) = 4k+1 then a(n) = k = A076410(n).