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.

Showing 1-2 of 2 results.

A096636 Smallest prime p > prime(n+2) such that p is a quadratic residue mod the first n odd primes 3, 5, 7, 11, ..., prime(n+1), and p is a quadratic non-residue mod prime(n+2).

Original entry on oeis.org

5, 7, 19, 79, 331, 751, 1171, 7459, 10651, 18379, 90931, 78439, 399499, 644869, 2631511, 1427911, 4355311, 5715319, 49196359, 43030381, 163384621, 249623581, 452980999, 1272463669, 505313251
Offset: 0

Views

Author

Robert G. Wilson v, Jun 24 2004

Keywords

Comments

Same as smallest prime p with property that the Legendre symbol (p|q) = 1 for the first n odd primes q = prime(k+1), k = 1, 2, ..., n, and (p|q) = -1 for q = prime(n+2). - T. D. Noe, Mar 06 2013

Examples

			Let f(p) = list of Legendre(p|q) for q = 3,5,7,11,13,...
Then f(3), f(5), f(7), f(11), ... are:
p=3: 0, -1, -1, 1, 1, -1, -1, 1, -1, -1, 1, -1, -1, 1, -1, 1, 1, -1, 1, 1, -1, 1, -1, ...
p=5: -1, 0, -1, 1, -1, -1, 1, -1, 1, 1, -1, 1, -1, -1, -1, 1, 1, -1, 1, -1, 1, -1, 1, ...
p=7: 1, -1, 0, -1, -1, -1, 1, -1, 1, 1, 1, -1, -1, 1, 1, 1, -1, -1, -1, -1, -1, 1, -1, ...
p=11: -1, 1, 1, 0, -1, -1, 1, -1, -1, -1, 1, -1, 1, -1, 1, -1, -1, -1, -1, -1, 1, 1, 1, ...
p=13: 1, -1, -1, -1, 0, 1, -1, 1, 1, -1, -1, -1, 1, -1, 1, -1, 1, -1, -1, -1, 1, -1, -1, ...
p=17: -1, -1, -1, -1, 1, 0, 1, -1, -1, -1, -1, -1, 1, 1, 1, 1, -1, 1, -1, -1, -1, 1, 1, ...
p=19: 1, 1, -1, -1, -1, 1, 0, -1, -1, 1, -1, -1, -1, -1, -1, 1, 1, 1, 1, 1, 1, -1, -1, ...
p=5 is the first list that begins with -1, so a(0) = 5,
p=7 is the first list that begins 1, -1, so a(1) = 7,
p=19 is the first list that begins 1, 1, -1, so a(2) = 19.
		

Crossrefs

Cf. A094929, A222756 (p and q switched).
See also A096637, A096638, A096639, A096640. - Jonathan Sondow, Mar 07 2013

Programs

  • Mathematica
    f[n_] := Block[{k = 2}, While[ JacobiSymbol[n, Prime[k]] == 1, k++ ]; Prime[k]]; t = Table[0, {50}]; Do[p = Prime[n]; a = f[p]; If[ t[[ PrimePi[a]]] == 0, t[[ PrimePi[a]]] = p; Print[ PrimePi[a], " = ", p]], {n, 10^9}]

Extensions

Better definition from T. D. Noe, Mar 06 2013
Entry revised by N. J. A. Sloane, Mar 06 2013
Simpler definition from Jonathan Sondow, Mar 06 2013

A096634 Let p = n-th prime == 5 (mod 8) (A007521); a(n) = smallest prime q such that p is not a square mod q.

Original entry on oeis.org

3, 5, 3, 5, 3, 7, 3, 11, 3, 5, 3, 7, 3, 7, 3, 5, 3, 3, 7, 5, 3, 5, 13, 3, 3, 11, 3, 5, 3, 7, 3, 3, 13, 5, 5, 3, 3, 3, 7, 5, 5, 3, 5, 3, 7, 3, 7, 5, 3, 5, 3, 5, 3, 5, 3, 3, 3, 11, 11, 5, 3, 13, 5, 3, 17, 3, 7, 5, 3, 3, 7, 11, 7, 3, 3, 5, 3, 3, 3, 7, 5, 3, 3, 3, 11, 3, 13, 5, 3, 3, 7, 3, 3, 11, 5, 3, 3, 5, 3
Offset: 1

Views

Author

Robert G. Wilson v, Jun 24 2004

Keywords

Crossrefs

Programs

  • Maple
    g:= proc(n) local p;
      p:= 1;
      do
        p:= nextprime(p);
        if numtheory:-quadres(n,p) = -1 then return p fi
      od
    end proc:
    map(g, select(isprime, [seq(i,i=5..10000,8)])); # Robert Israel, Apr 17 2023
  • Mathematica
    f[n_] := Block[{k = 2}, While[ JacobiSymbol[n, Prime[k]] == 1, k++ ]; Prime[k]]; f /@ Select[ Prime[ Range[435]], Mod[ #, 8] == 5 &]
Showing 1-2 of 2 results.