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.

A002224 Smallest prime p of form p = 8k+1 such that first n primes (p_1=2, ..., p_n) are quadratic residues mod p.

Original entry on oeis.org

17, 73, 241, 1009, 2689, 8089, 33049, 53881, 87481, 483289, 515761, 1083289, 3818929, 3818929, 9257329, 22000801, 48473881, 48473881, 175244281, 427733329, 427733329, 898716289, 8114538721, 9176747449, 23616331489, 23616331489, 23616331489, 196265095009, 196265095009, 196265095009, 196265095009, 2871842842801, 2871842842801, 2871842842801, 26437680473689
Offset: 1

Views

Author

Keywords

Examples

			32^2 = 2 mod 73, 21^2 = 3 mod 73.
		

References

  • N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
  • A. E. Western and J. C. P. Miller, Tables of Indices and Primitive Roots. Royal Society Mathematical Tables, Vol. 9, Cambridge Univ. Press, 1968, p. XV.

Crossrefs

Programs

  • Mathematica
    f[n_] := Block[{k = 2}, While[JacobiSymbol[n, Prime[k]] == 1, k++ ]; Prime[k]] (* Robert G. Wilson v *)
    np[] := While[p = NextPrime[p]; Mod[p, 8] != 1]; p = 2; A002224 = {}; pp = {2}; np[]; While[Length[A002224] < 25, If[Union[JacobiSymbol[#, p] &[pp]] === {1}, AppendTo[pp, NextPrime[Last[pp]]]; Print[p]; AppendTo[A002224, p], np[]]]; A002224 (* Jean-François Alcover, Sep 09 2011 *)
  • PARI
    a(n,startAt=17)=my(v=primes(n)); forprime(p=startAt,, if(p%8>1, next); for(i=1,n, if(kronecker(v[i],p)<1, next(2))); return(p)) \\ Charles R Greathouse IV, Jun 26 2017

Extensions

More terms from Don Reble, Sep 19 2001
More terms from Mike Oakes, Nov 28 2022