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

A088201 Distance p_n-LQnR(p_n) (A088198) where the difference sequence (A088197) of LQnR(p_n) (A088196) is <= 0.

Original entry on oeis.org

5, 5, 7, 5, 5, 7, 5, 11, 5, 11, 7, 7, 7, 5, 7, 5, 5, 13, 5, 7, 11, 7, 7, 11, 13, 5, 7, 11, 7, 5, 11, 7, 7, 5, 7, 7, 7, 13, 7, 7, 11, 7, 5, 5, 11, 7, 7, 7, 13, 13, 17, 5, 11, 11, 17, 11, 7, 7, 13, 5, 7, 7, 13, 7, 5, 7, 7, 5, 5, 13, 5, 7, 11, 13, 7, 7, 17, 11, 5, 7, 11, 11, 7, 11, 7, 7, 5, 7
Offset: 1

Views

Author

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

Keywords

Comments

The terms are conjectured to be odd primes > 3.
It is also conjectured that the i-th member of A088200 is -2 if and only if a(i) is 5.
The terms are conjectured to be odd primes > 3 (the primality is provable).

Crossrefs

Programs

  • PARI
    qnrp_pm_nm(n)= {/* The distance of p from LQnR where the sequence of the largest QnR modulo the primes is nonmonotonic */ local(k=1,m,p,fl,jj,j,v=[]); for(i=2,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--); if(m-k<=0,v=concat(v,p-m)); k=m); print(v)}

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)

A088196 Largest number that is not a quadratic residue modulo prime(n).

Original entry on oeis.org

2, 3, 6, 10, 11, 14, 18, 22, 27, 30, 35, 38, 42, 46, 51, 58, 59, 66, 70, 68, 78, 82, 86, 92, 99, 102, 106, 107, 110, 126, 130, 134, 138, 147, 150, 155, 162, 166, 171, 178, 179, 190, 188, 195, 198, 210, 222, 226, 227, 230, 238, 234, 250, 254, 262, 267, 270, 275, 278
Offset: 2

Views

Author

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

Keywords

Comments

These are sometimes called quadratic non-residues modulo p(n). Denote a(n) by LQnR(p_n).

Crossrefs

Programs

  • PARI
    qnrp(fr,n)= {/* 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,m)); print(v)}

A088200 Members of the difference sequence (A088197) of LQnR(p_n) (A088196) where it is <= 0.

Original entry on oeis.org

-2, -2, -4, -2, -2, -4, -2, -4, -2, 0, -4, -4, -4, -2, -4, -2, -2, -10, -2, -4, 0, -4, -4, -8, -10, -2, -4, 0, -4, -2, -4, -4, -4, -2, -4, 0, -4, -6, -4, 0, -8, -4, -2, -2, 0, -4, -4, -4, -10, -2, -14, -2, 0, 0, -6, -4, -4, 0, -10, -2, 0, -4, -10, -4, -2, 0, -4, -2, -2, -6, -2, -4, 0, -2, -4, -4, -10, -8, -2, 0, 0, -8, -4, -8, -4, 0, -2
Offset: 1

Views

Author

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

Keywords

Comments

The members of the sequence are always even (conjectured!).

Crossrefs

Programs

  • PARI
    qnrp_d_nm(n)= {/* The difference sequence of LQnR where the sequence of the largest QnR modulo the primes is nonmonotonic */ local(k=1,m,p,fl,jj,j,v=[]); for(i=2,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--); if(m-k<=0,v=concat(v,m-k)); k=m); print(v)}

A088197 First differences of A088196.

Original entry on oeis.org

1, 3, 4, 1, 3, 4, 4, 5, 3, 5, 3, 4, 4, 5, 7, 1, 7, 4, -2, 10, 4, 4, 6, 7, 3, 4, 1, 3, 16, 4, 4, 4, 9, 3, 5, 7, 4, 5, 7, 1, 11, -2, 7, 3, 12, 12, 4, 1, 3, 8, -4, 16, 4, 8, 5, 3, 5, 3, 4, 9, 15, 4, -2, 7, 15, 2, 14, 1, 3, 8, 8, 5, 7, 4, 5, 8, 3, 4, 16, 1, 11, -2, 10, 4, 4, 6, 7, 3, 4, 12, 8, 4, 8, 4, 5, 11, 4, 17
Offset: 2

Views

Author

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

Keywords

Crossrefs

Programs

  • PARI
    qnrp_d(n)= { /* The difference sequence of the sequence with the largest QnR modulo the primes */ local(k=1,m,p,fl,jj,j,v=[]); for(i=3,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,m-k); k=m); print(v)}

A088199 Primes where the difference sequence (A088197) of LQnR(p_n) (A088196) is <= 0.

Original entry on oeis.org

73, 193, 241, 313, 433, 601, 1033, 1129, 1153, 1201, 1321, 1489, 1609, 1873, 2089, 2113, 2593, 2689, 2713, 3001, 3049, 3121, 3169, 3361, 3529, 3673, 3769, 3889, 4129, 4273, 4729, 4801, 4969, 5233, 5281, 5449, 5521, 5569, 5641, 5689, 5881, 6361, 6553
Offset: 1

Views

Author

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

Keywords

Comments

The members of the sequence are always == 1 modulo 8 (conjectured!).

Crossrefs

Programs

  • PARI
    qnrp_p_nm(n)= {/* The primes where the sequence of the largest QnR modulo the primes is nonmonotonic */ local(k=1,m,p,fl,jj,j,v=[]); for(i=2,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--); if(m-k<=0,v=concat(v,p)); k=m); print(v)}

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

A354974 Distance LQnR(n) (A334819) from n.

Original entry on oeis.org

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

Views

Author

Joel Brennan, Jun 14 2022

Keywords

Comments

a(n) is the distance between n and the largest quadratic nonresidue modulo n: a(n) = n - A334819(n). So n - a(n) is the largest nonsquare modulo n.

Examples

			The nonsquares modulo 8 are 2, 3, 5, 6, and 7, so the distance of the largest quadratic nonresidue from 8 is a(8) = 1. The quadratic nonresidues modulo 17 are 3, 5, 6, 7, 10, 11, 12, and 14, so a(17) = 17 - 14 = 3.
		

Crossrefs

Programs

  • Mathematica
    a[n_] := n - Max @ Complement[Range[n - 1], Mod[Range[n/2]^2, n]]; Array[a, 100, 3] (* Amiram Eldar, Jun 15 2022 *)
  • PARI
    a(n) = forstep(r = n - 1, 1, -1, if(!issquare(Mod(r, n)), return(n-r))) \\ Thomas Scheuerle, Jun 15 2022
Showing 1-8 of 8 results.