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

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

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

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

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.

A091381 First differences of A091380.

Original entry on oeis.org

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

Views

Author

Ferenc Adorjan (fadorjan(AT)freemail.hu)

Keywords

Comments

Seemingly, the difference sequence is mostly positive. There are special characteristic features, where it is nonpositive (see A091383-A091385).

Crossrefs

Programs

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