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-10 of 13 results. Next

A088195 Distance (A088192) of primes from the largest quadratic residues modulo the primes (A088190), where the latter is non-monotonic.

Original entry on oeis.org

3, 3, 3, 7, 3, 3, 3, 7, 3, 11, 7, 3, 7, 11, 3, 11, 7, 3, 3, 3, 3, 7, 17, 7, 3, 3, 3, 3, 3, 3, 13, 3, 11, 3, 7, 3, 11, 3, 3, 3, 3, 3, 13, 3, 11, 3, 3, 3, 3, 3, 11, 7, 11, 13, 3, 7, 7, 11, 7, 3, 3, 11, 19, 3, 11, 3, 3, 11, 17, 3, 11, 3, 7, 3, 13, 3, 3, 3, 3, 11, 11, 3, 3, 3, 3, 13, 19, 3, 3, 3, 7, 11
Offset: 1

Views

Author

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

Keywords

Comments

The values are some odd primes, but never 5. The maximum value increases very slowly, it only reaches 31 for the first 20000 primes.
It is conjectured that if we denote the members of A088194 by D(n) and the member of this sequence by M(n) then if D(n)=-1 then M(n)=7, while if M(n)=3 then D(n)=0.
The values are odd primes, but never 5 (the primality is provable). The maximum value increases very slowly: it only reaches 43 for the first 10^5 primes.

Crossrefs

Programs

  • PARI
    qrp_pm_nm(to)= {/* The distance of LQR from the primes where the sequence of the largest QR modulo the primes is non-monotonic */ local(m,k=1,p,v=[]); for(i=2,to,m=1; p=prime(i); j=2; while((j<=(p-1)/2)&&(m
    				

A088190 Largest quadratic residue modulo prime(n).

Original entry on oeis.org

1, 1, 4, 4, 9, 12, 16, 17, 18, 28, 28, 36, 40, 41, 42, 52, 57, 60, 65, 64, 72, 76, 81, 88, 96, 100, 100, 105, 108, 112, 124, 129, 136, 137, 148, 148, 156, 161, 162, 172, 177, 180, 184, 192, 196, 196, 209, 220, 225, 228, 232, 232, 240, 249, 256, 258, 268, 268, 276
Offset: 1

Views

Author

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

Keywords

Comments

Denote a(n) by LQR(p_n). Observations (tested up to 20000 primes): - the sequence of largest QR modulo the primes (LQR(p_n) is 'almost' monotonic, - p_n-LQR(p_n) is either 1 or a prime value (see A088192) - if LQR(p_n)<=LQR(p_{n-1}) then p_n==7 mod 8 (when n>2) (see A088194) - if LQR(p_n)<=LQR(p_{n-1}) then p_n-LQR(p_n) is an odd prime, but never 5 (see A088195) For a similar set of sequences, related to quadratic non-residues, see A088196-A088201.
From Robert Israel, Oct 31 2024: (Start)
a(n) = prime(n)-1 if and only if n is 1 or in A080147.
a(n) = prime(n)-2 if and only if prime(n) is in A007520.
a(n) = prime(n)-3 if and only if prime(n) is in A107006. (End)

Crossrefs

Programs

  • Maple
    lqr:= proc(p) local k;
      for k from p-1 by -1 do if numtheory:-quadres(k,p) = 1 then return k fi od:
    end proc:
    seq(lqr(ithprime(i)),i=1..100); # Robert Israel, Oct 31 2024
  • Mathematica
    a[n_] := With[{p = Prime[n]}, SelectFirst[Range[p - 1, 1, -1], JacobiSymbol[#, p] == 1&]]; Array[a, 100] (* Jean-François Alcover, Feb 16 2018 *)
  • PARI
    qrp(fr,to)= {/* Sequence of the largest QR modulo the primes */ local(m,p,v=[]); for(i=fr,to,m=1; p=prime(i); j=2; while((j<=(p-1)/2)&&(m
    				

Formula

a(n) = max(r, r==j^2 mod p(n)|j=1, 2, ...(p(n)-1)/2)

A088191 First differences of A088190.

Original entry on oeis.org

0, 3, 0, 5, 3, 4, 1, 1, 10, 0, 8, 4, 1, 1, 10, 5, 3, 5, -1, 8, 4, 5, 7, 8, 4, 0, 5, 3, 4, 12, 5, 7, 1, 11, 0, 8, 5, 1, 10, 5, 3, 4, 8, 4, 0, 13, 11, 5, 3, 4, 0, 8, 9, 7, 2, 10, 0, 8, 4, 1, 11, 13, -5, 12, 4, 13, 7, 9, 3, 4, 0, 12, 8, 5, 1, 10, 8, 4, 8, 9, 3, 4, 8, 4, 5, 7, 8, 4, 0, 5, 1, 18, 5, 8, 1, 10, 12, 1, 19
Offset: 1

Views

Author

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

Keywords

Comments

Seemingly the difference sequence is mostly positive. There are special characteristic features where it is nonpositive. (See A088193-A088195.)

Crossrefs

Programs

  • PARI
    qrp_d(to)= {/* Difference sequence of the largest QR modulo the primes */ local(m,k=1,p,v=[]); for(i=2,to,m=1; p=prime(i); j=2; while((j<=(p-1)/2)&&(m
    				

A088193 Prime numbers where the sequence of largest quadratic residues modulo the primes (A088190) is non-monotonic.

Original entry on oeis.org

3, 7, 31, 71, 103, 151, 199, 239, 271, 311, 359, 463, 599, 719, 823, 839, 911, 1063, 1231, 1279, 1303, 1439, 1559, 1871, 1879, 1951, 1999, 2143, 2239, 2311, 2351, 2383, 2399, 2551, 2711, 2791, 3191, 3391, 3463, 3559, 3583, 3823, 3911, 3919, 4079, 4159
Offset: 1

Views

Author

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

Keywords

Comments

From the second term on, these primes are always ==7 mod 8. (Tested for the first 20000 primes)
From Robert Israel, Oct 31 2024: (Start)
This is true because if prime(n) == 1 mod 4, A088190(n) = prime(n) - 1 while if prime(n) == 3 mod 8, A088190(n) = prime(n) - 2. In either case, A088190(n) > prime(n-1) - 1 >= A088190(n-1).
Primes prime(n) such that A088190(n) <= A088190(n-1). (End)

Crossrefs

Programs

  • Maple
    lqr:= proc(p) local k;
      for k from p-1 by -1 do if numtheory:-quadres(k,p) = 1 then return k fi od:
    end proc:
    p:= 2: v:= lqr(2): R:= NULL: count:= 0:
    while count < 100 do
      q:= p; vq:= v; p:= nextprime(p); v:= lqr(p);
      if v <= vq then R:= R,p; count:= count+1;
      fi
    od:
    R; # Robert Israel, Oct 31 2024
  • PARI
    qrp_p_nm(to)= {/* The primes where the sequence of the largest QR modulo the primes is non-monotonic */ local(m,k=1,p,v=[]); for(i=2,to,m=1; p=prime(i); j=2; while((j<=(p-1)/2)&&(m
    				

A088198 Distance LQnR(p_n) (A088196) from p_n.

Original entry on oeis.org

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

Views

Author

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

Keywords

Comments

The members of the sequence are either 1's or primes (easily provable).

Crossrefs

Programs

  • Mathematica
    qrQ[n_, p_] := Length[ Select[ Table[x^2, {x, 1, Floor[p/2]}], Mod[#, p] == n & , 1]] == 1; LQnR[p_] := Catch[ Do[ If[ !qrQ[k, p], Throw[k]], {k, p-1, 0, -1}]]; a[n_] := (p = Prime[n]; p - LQnR[p]); Table[a[n], {n, 2, 100}] (* Jean-François Alcover, May 14 2012 *)
  • PARI
    qnrp_pm(fr,n)= {/* The distance of primes from the largest QnR modulo the primes */ local(m,p,fl,jj,j,v=[]); fr=max(fr,2); for(i=fr,n,m=0; p=prime(i); jj=0; fl=2^p-1; j=2; while((j<=(p-1)/2),jj=(j^2)%p; fl-=2^jj; j++); j=p-1; while(m==0,if(bitand(2^j,fl),m=j); j--); v=concat(v,p-m)); print(v)}

Formula

a(n) = prime(n)-LQnR(prime(n)) = A000040(n)-A088196(n), where prime(n) is the n-th prime and LQnR(m) is the largest quadratic non-residue modulo m.

A088194 Members of the difference sequence (A088191) of the sequence of largest quadratic residues modulo the primes (A088190), where the latter is non-monotonic.

Original entry on oeis.org

0, 0, 0, -1, 0, 0, 0, 0, 0, -5, 0, 0, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, -10, -1, 0, 0, 0, 0, 0, 0, -7, 0, -4, 0, -1, 0, -5, 0, 0, 0, 0, 0, -7, 0, -4, 0, 0, 0, 0, 0, -4, 0, 0, -2, 0, -1, 0, -5, 0, 0, 0, 0, -8, 0, 0, 0, 0, -4, -11, 0, 0, 0, -1, 0, -2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -2, -5, 0, 0, 0, 0, -5, 0, 0, -5, 0, 0, 0, -1
Offset: 1

Views

Author

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

Keywords

Comments

The negative values are either primes or composites (Cf. A088200).

Crossrefs

Programs

  • PARI
    qrp_d_nm(to)= {/* The difference sequence values where the sequence of the largest QR modulo the primes is non-monotonic */ local(m,k=1,p,v=[]); for(i=2,to,m=1; p=prime(i); j=2; while((j<=(p-1)/2)&&(m
    				

A091382 Distance between the sequence of primes and the largest "mixed" quadratic residues modulo the primes (A091380).

Original entry on oeis.org

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

Views

Author

Ferenc Adorjan (fadorjan(AT)freemail.hu)

Keywords

Comments

Apart from the first term, it contains solely primes. Is every prime in there?
Apart from the first term and the definition, it is identical to the sequence A053760 by S. R. Finch.

Crossrefs

Programs

  • PARI
    {/* Distance of primes from the sequence of the largest "mixed" QR modulo the primes */ p_lqxr(to)=local(v=[1],k,r,q,p); for(i=2,to,p=prime(i);k=p-1;r=p%4-2; while(kronecker(k,p)<>r,k-=1); v=concat(v,p-k)); print(v) }

A220861 Choose smallest m>0 such that the n-th rational prime p ramifies in the imaginary quadratic extension field K = Q(sqrt(-m)); a(n) = discriminant(K).

Original entry on oeis.org

-4, -3, -20, -7, -11, -52, -68, -19, -23, -116, -31, -148, -164, -43, -47, -212, -59, -244, -67, -71, -292, -79, -83, -356, -388, -404, -103, -107, -436, -452, -127, -131, -548, -139, -596, -151, -628, -163, -167, -692, -179, -724, -191, -772, -788, -199
Offset: 1

Views

Author

N. J. A. Sloane, Dec 26 2012

Keywords

Comments

m=1 if p=2, otherwise m=p.

References

  • David A. Cox, "Primes of the Form x^2 + n y^2", Wiley, 1989, Cor. 5.17, p. 105.

Crossrefs

Formula

Let p = prime(n). Then a(n) = -4 if p = 2, -p if p == 3 mod 4, -4p if p == 1 mod 4.

A220862 a(n) = smallest m>0 such that the n-th rational prime p splits in the imaginary quadratic extension field K = Q(sqrt(-m)).

Original entry on oeis.org

-7, -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

N. J. A. Sloane, Dec 26 2012

Keywords

Comments

Except for the first term, a(n) = -A088192(n).

References

  • David A. Cox, "Primes of the Form x^2 + n y^2", Wiley, 1989, Cor. 5.17, p. 105.

Crossrefs

A220863 Choose smallest m>0 such that the n-th rational prime p splits in the imaginary quadratic extension field K = Q(sqrt(-m)); a(n) = discriminant(K).

Original entry on oeis.org

-7, -8, -4, -3, -8, -4, -4, -8, -20, -4, -3, -4, -4, -8, -20, -4, -8, -4, -8, -7, -4, -3, -8, -4, -4, -4, -3, -8, -4, -4, -3, -8, -4, -8, -4, -3, -4, -8, -20, -4, -8, -4, -7, -4, -4, -3, -8, -3, -8, -4, -4, -7, -4, -8, -4, -20, -4, -3, -4, -4, -8, -4, -8, -11, -4, -4, -8, -4, -8, -4, -4, -7, -3, -4, -8
Offset: 1

Views

Author

N. J. A. Sloane, Dec 26 2012

Keywords

Comments

a(n) = discriminant of extension field defined in A220862.

References

  • David A. Cox, "Primes of the Form x^2 + n y^2", Wiley, 1989, Cor. 5.17, p. 105.

Crossrefs

Formula

Let i = A220862(n). Then a(n) = i if i == 1 (mod 4), otherwise 4i.
Showing 1-10 of 13 results. Next