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-5 of 5 results.

A088192 Distance between prime(n) and the largest quadratic residue modulo prime(n).

Original entry on oeis.org

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

Views

Author

Ferenc Adorjan (fadorjan(AT)freemail.hu), Sep 22 2003

Keywords

Comments

a(n) = smallest m>0 such that -m is a quadratic residue modulo prime(n).
a(n) = smallest m>0 such that prime(n) either splits or ramifies in the imaginary quadratic field Q(sqrt(-m)). Equals -A220862(n) except when n = 1. Cf. A220861, A220863. - N. J. A. Sloane, Dec 26 2012
The values are 1 or a prime number (easily provable!). The maximum occurring prime values increase very slowly: up to 10^5 terms the largest prime is 43. The primes do not appear in order.

References

  • David A. Cox, "Primes of the Form x^2 + n y^2", Wiley, 1989, Cor. 5.17, p. 105. - From N. J. A. Sloane, Dec 26 2012

Crossrefs

Records are (essentially) given by A147971.

Programs

  • Mathematica
    a[n_] := With[{p = Prime[n]}, If[JacobiSymbol[-1, p] > 0, 1, For[d = 2, True, d = NextPrime[d], If[JacobiSymbol[-d, p] >= 0, Return[d]]]]]; Array[a, 100] (* Jean-François Alcover, Feb 16 2018, after Charles R Greathouse IV *)
  • PARI
    qrp_pm(fr,to)= {/* The distance of largest QR modulo the primes from the primes */ local(m,p,v=[]); for(i=fr,to,m=1; p=prime(i); j=2; while((j<=(p-1)/2)&&(m
    				
  • PARI
    do(p)=if(kronecker(-1,p)>0, 1, forprime(d=2, p, if(kronecker(-d, p) >= 0, return(d))))
    apply(do, primes(100)) \\ Charles R Greathouse IV, Oct 31 2012

Formula

a(n) = A053760(n) unless -1 is a quadratic residue mod prime(n). - Charles R Greathouse IV, Oct 31 2012

Extensions

Edited by Max Alekseyev, Oct 29 2012

A147969 Smallest prime p modulo which numbers 1,2,...,n are quadratic residues.

Original entry on oeis.org

2, 7, 23, 23, 71, 71, 311, 311, 311, 311, 479, 479, 1559, 1559, 1559, 1559, 5711, 5711, 10559, 10559, 10559, 10559, 18191, 18191, 18191, 18191, 18191, 18191, 31391, 31391, 366791, 366791, 366791, 366791, 366791, 366791, 366791, 366791, 366791
Offset: 1

Views

Author

Max Alekseyev, Nov 18 2008

Keywords

Comments

The same primes without repetitions are listed in A147970.

Crossrefs

Programs

  • PARI
    a(n)=forprime(p=2,default(primelimit),forprime(i=2,n, if(kronecker(i,p)<1,next(2)));return(p)) \\ Charles R Greathouse IV, Apr 06 2012

A147970 Primes corresponding to the records in the sequence of smallest positive quadratic nonresidues (A053760).

Original entry on oeis.org

2, 7, 23, 71, 311, 479, 1559, 5711, 10559, 18191, 31391, 366791, 3818929, 9257329, 22000801, 36415991, 48473881, 120293879, 131486759, 2929911599, 7979490791, 23616331489, 89206899239, 121560956039, 196265095009, 513928659191, 5528920734431, 8402847753431, 70864718555231
Offset: 1

Views

Author

Max Alekseyev, Nov 18 2008

Keywords

Crossrefs

Formula

Prime p=A000040(n) is in this sequence iff A053760(k) < A053760(n) for every kA000040(A147971(n))

Extensions

a(20)-a(29) from Charles R Greathouse IV, Apr 06 2012

A147972 Smallest prime p modulo which the first n primes are nonzero quadratic residues.

Original entry on oeis.org

7, 23, 71, 311, 479, 1559, 5711, 10559, 18191, 31391, 366791, 366791, 366791, 3818929, 9257329, 22000801, 36415991, 48473881, 120293879, 120293879, 131486759, 131486759, 2929911599, 2929911599, 7979490791, 23616331489, 23616331489, 89206899239, 121560956039, 196265095009, 196265095009, 513928659191, 5528920734431, 8402847753431, 8402847753431, 8402847753431, 70864718555231
Offset: 1

Views

Author

Max Alekseyev, Nov 18 2008

Keywords

Comments

The same primes without repetitions are listed in A147970.
a(n) <= min{A002223(n), A002224(n)}. What is the smallest n for which this inequality is strict?
By definition, a(n) == 1, 7 (mod 8), so a(n) = min{A002223(n), A002224(n)}. - Jianing Song, Feb 18 2019

Crossrefs

Smallest prime p such that each of the first n primes has q q-th roots mod p: this sequence (q=2), A002225 (q=3), A002226 (q=5), A002227 (q=7), A002228 (q=11), A060363 (q=13), A060364 (q=17).

Programs

  • Mathematica
    (*version 7.0*)m=1;P=7;Lst={p};While[m<25,m++;S=Prime[Range[m]];While[MemberQ[JacobiSymbol[S,p],-1],p=NextPrime[p]];Lst=Append[Lst,P]];Lst (* Emmanuel Vantieghem, Jan 31 2012 *)
  • PARI
    t=2;forprime(p=2,1e9,forprime(q=2,t,if(kronecker(q,p)<1,next(2)));print1(p", ");t=nextprime(t+1);p--) \\ Charles R Greathouse IV, Jan 31 2012

Formula

a(n) >= min{A002189(n-1), A045535(n-1)}. - Jianing Song, Feb 18 2019

Extensions

a(23)-a(25) from Emmanuel Vantieghem, Jan 31 2012
a(26)-a(37) from Max Alekseyev, Aug 21 2015

A210488 a(n) is the index of A210487 when the n-th prime appears for the first time.

Original entry on oeis.org

3, 4, 2, 20, 60, 92, 246, 752, 1289, 2084, 3383
Offset: 1

Views

Author

Lei Zhou, Jan 23 2013

Keywords

Examples

			In A210487, 2 appears for the first time as A210487(3), so a(1)=3;
3 appears for the first time as A210487(4), so a(2)=4;
5 appears for the first time as A210487(2), so a(3)=2.
		

Crossrefs

Programs

  • Maple
    N := 60 ;
    A210488 := [seq(0,i=1..N)] ;
    for n from 2 do
        a := A210487(n) ;
        if isprime(a) then
            idx := numtheory[pi](a) ;
            if idx <= N then
            if op(idx,A210488) = 0 then
                A210488  := subsop(idx=n,A210488) ;
                print(A210488) ;
            end if;
            end if;
        end if;
    end do: # R. J. Mathar, Apr 17 2013
  • Mathematica
    nn = 11; a = Table[0, {nn}]; k = 1; While[Times @@ a == 0, k++; p1 = Prime[k]; id = PrimePi[Min[Table[Last[FactorInteger[Prime[k]^2 - Prime[j]^2]][[1]], {j, k - 1}]]]; If[id <= nn && a[[id]] == 0, a[[id]] = k]]; a
Showing 1-5 of 5 results.