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.

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