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.

A097159 Smallest prime p such that there are n consecutive quadratic residues mod p.

Original entry on oeis.org

2, 7, 11, 19, 43, 67, 83, 131, 283, 277, 467, 479, 1907, 1607, 2543, 1559, 5443, 5711, 6389, 14969, 25703, 10559, 20747, 52057, 136223, 90313, 162263, 18191, 167107, 31391, 376589, 607153, 671947
Offset: 1

Views

Author

Robert G. Wilson v, Jul 28 2004

Keywords

Comments

Additional terms less than 10^6: a(35)=298483, a(36)=422231, a(40)=701399 and a(42)=366791. - T. D. Noe, Apr 03 2007

Examples

			a(22)=10559, a(23)=20747 & a(28)=18191.
		

Crossrefs

Programs

  • Mathematica
    f[l_, a_] := Module[{A = Split[l], B}, B = Last[ Sort[ Cases[A, x : {a ..} :> { Length[x], Position[A, x][[1, 1]] }] ]]; {First[B], Length[ Flatten[ Take[A, Last[B] - 1]]] + 1}]; g[n_] := g[n] = f[ JacobiSymbol[ Range[ Prime[n] - 1], Prime[n]], 1][[1]]; g[1] = 1; a = Table[0, {30}]; Do[b = g[n]; If[ a[[b]] < 31 && a[[b]] == 0, a[[b]] = n; Print[b, " = ", Prime[n]]], {n, 2555}]

Extensions

More terms from T. D. Noe, Apr 03 2007

A002308 Consecutive quadratic nonresidues mod p.

Original entry on oeis.org

0, 1, 2, 2, 3, 4, 3, 4, 4, 3, 4, 4, 5, 5, 4, 6, 5, 6, 6, 6, 4, 6, 7, 6, 6, 5, 7, 6, 10, 4, 7, 8, 5, 5, 6, 7, 5, 6, 6, 5, 6, 6, 6, 5, 5, 6, 7, 7, 7, 6, 7, 6, 5, 7, 6, 7, 9, 7, 7, 7, 9, 5, 7, 10, 7, 7, 8, 7, 8, 6, 8, 8, 9, 5, 8, 8, 5, 8, 9, 7, 8, 12, 6, 7, 10, 8, 9, 9, 7, 8, 11, 12, 8, 8, 10, 8, 7, 6, 10, 10, 9, 7, 10, 9, 7, 6, 9
Offset: 1

Views

Author

Keywords

Comments

a(n) is the maximal number of positive reduced quadratic nonresidues which appear consecutively for the n-th prime.
When prime(n) == 3 (mod 4), then a(n) = A002307(n). - T. D. Noe, Apr 03 2007

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).

Crossrefs

Cf. A002307.

Programs

  • Mathematica
    f[l_, a_] := Module[{A = Split[l], B}, B = Last[Sort[ Cases[A, x : {a ..} :> {Length[x], Position[A, x][[1, 1]]}]]]; {First[B], Length[Flatten[Take[A, Last[B] - 1]]] + 1}]; g[n_] := f[-JacobiSymbol[Range[Prime[n] - 1], Prime[n]], 1][[1]]; g[1] = 0; Table[g[n], {n, 1, 107}] (* Jean-François Alcover, Oct 17 2012, after the Mathematica code of Robert G. Wilson v in A002307 *)

Extensions

More terms from David W. Wilson
Showing 1-2 of 2 results.