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-3 of 3 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

A097161 Number of primes modulo which the largest number of consecutive quadratic residues is n.

Original entry on oeis.org

3, 3, 3, 11, 12, 34, 54, 97, 180, 351
Offset: 1

Views

Author

Robert G. Wilson v, Jul 29 2004

Keywords

Comments

I am not sure how many of these entries have been proved to be correct. See comments in A097160. - N. J. A. Sloane, Jan 01 2007

Examples

			7, 13 & 17 have exactly two consecutive quadratic residues.
11, 41 & 53 have exactly three consecutive quadratic residues.
19, 23, 29, 31, 37, 47, 73, 89, 97, 149 & 193 have exactly four consecutive quadratic residues.
43, 59, 61, 109, 113, 139, 229, 313, 317, 337, 397 & 457 have exactly five consecutive quadratic residues.
67, 71, 79, 107, 137, 157, 163, 167, 173, 179, 181, 191, 199, 233, 239, 241, 257, 281, 349, 353, 373, 409, 431, 577, 601, 617, 641, 769, 797, 857, 881, 1049, 1373 & 2153 have exactly six consecutive quadratic residues.
		

Crossrefs

A125607 Lesser of the smallest pair of consecutive positive reduced quadratic residues modulo p = prime(n) > 5.

Original entry on oeis.org

1, 3, 3, 1, 4, 1, 4, 1, 3, 1, 9, 1, 6, 3, 3, 9, 1, 1, 1, 3, 1, 1, 4, 1, 3, 3, 1, 1, 3, 1, 4, 4, 1, 3, 9, 1, 9, 3, 3, 1, 1, 6, 1, 4, 1, 3, 3, 1, 1, 1, 3, 1, 1, 4, 1, 3, 1, 6, 9, 6, 1, 1, 6, 4, 1, 3, 3, 1, 1, 1, 3, 4, 1, 4, 3, 1, 1, 3, 3, 1, 1, 1, 3, 1, 1, 4, 1, 3, 1, 1, 3, 4, 1, 4, 1, 6, 3, 9, 6, 3, 1, 4, 1, 3, 1
Offset: 4

Views

Author

Nick Hobson, Nov 30 2006

Keywords

Comments

For all n, a(n) exists and equals 1, 3, 4, 6 or 9. Proof: a(4)=1 by inspection. For n > 4 (p > 7), if 2 is a quadratic residue of p, then a(n)=1; otherwise if 5 is a quadratic residue of p, then a(n)=4 or 3; otherwise 2*5=10 is a quadratic residue of p and (9, 10) are consecutive residues. However, a(n)=8 or 7 is impossible as 8 cannot be a quadratic residue (since 2 is not), leaving 9 and 6 as the other possible values.
The constant 0.133141413191633911131141331131441391... = sum(a(n)/10^(n-3)) is conjectured to be irrational.

Examples

			The quadratic residues of 13=prime(6) are 1, 3, 4, 9, 10 and 12. The least consecutive pair of residues is (3, 4); hence a(6)=3.
		

Crossrefs

Programs

  • PARI
    vector(108, m, p=prime(m+3); if(p%8==1||p%8==7, 1, if(p%12==1||p%12==11, 3, if(p%10==1||p%10==9, 4, if((p%24==1||p%24==5||p%24==19||p%24==23) && (p%28==1||p%28==3||p%28==9||p%28==19||p%28==25||p%28==27), 6, 9)))))
Showing 1-3 of 3 results.