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 12 results. Next

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
    				

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
    				

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
    				

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

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

A091380 Largest quadratic "mixed" residue modulo the n-th prime (LQxR(p_n)).

Original entry on oeis.org

1, 1, 3, 4, 9, 11, 14, 17, 18, 27, 28, 35, 38, 41, 42, 51, 57, 59, 65, 76, 81, 86, 92, 99, 100, 105, 107, 110, 124, 129, 134, 137, 147, 148, 155, 161, 162, 171, 177, 179, 184, 188, 195, 196, 209, 220, 225, 227, 230, 232, 234, 249, 254, 258, 267, 268, 275, 278, 281
Offset: 1

Views

Author

Ferenc Adorjan (fadorjan(AT)freemail.hu)

Keywords

Comments

Due to the quadratic reciprocity (Euler's criterion), if a prime p is congruent to 1 mod 4, then (p-1) is a quadratic residue mod p (see A088190). Also, if p is congruent -1 mod 4 then p-1 is a quadratic non-residue mod p (see A088196). This sequence is created in such a way that when p is not congruent to 1 mod 4 then the largest quadratic residue is taken, otherwise the largest quadratic non-residue taken modulo p. Thus it is a merger of A088190 and A088196 by skipping the "trivial" terms. Important observations (tested up to 10^5 primes): - the sequence of largest "mixed" residues modulo the primes (denoted by LQxR(p_n)) is 'almost' monotonic, - for n>1, p_n-LQxR(p_n) is a prime value (see A091382) - if LQxR(p_n)<=LQxR(p_{n-1}) then p_n==+-1 mod 8 (when n>2) (see A091384) - if LQxR(p_n)<=LQxR(p_{n-1}) then p_n-LQxR(p_n) is a prime q>5 (see A091385).

References

  • H. Cohn, Advanced Number Theory, p. 19, Dover Publishing (1962)

Crossrefs

Programs

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

Formula

a(1)=1; a(n>1)=max{r

A091383 Prime numbers where the sequence of largest quadratic "mixed" residues modulo the primes (A091380) 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

Author

Ferenc Adorjan (fadorjan(AT)freemail.hu)

Keywords

Comments

All of these primes belong to the +-1 least absolute reside classes modulo 8. (Tested for 10^5 primes.)
Where does this first differ from A088193 (if at all)? - R. J. Mathar, Aug 27 2025

Programs

  • PARI
    {/* The primes where the sequence of the largest "mixed" QR modulo the primes is non-monotonic */ lqxr_nm_p(to)=local(v=[],k,r,q,p,e=1,n=0,i=1); while(nr,k-=1); if(k-e<=0,v=concat(v,p);n+=1);e=k); print(i);print(v) }

A091384 Members of the difference sequence (A091381) of the sequence of largest quadratic "mixed" residues modulo the primes (A091380) where the latter is non-monotonic.

Original entry on oeis.org

0, -1, -5, -1, -3, 0, 0, -8, 0, -1, 0, -7, -2, -6, -1, 0, 0, -5, -6, 0, 0, -7, -2, 0, -2, -3, -1, 0, -1, -5, -5, -7, -2, -11, 0, -1, 0, 0, -1, -2, -10, 0, 0, -6, -3, -1, -5, -5, -6, -5, 0, -1, -5, -7, -2, -5, -1, -5, 0, -2, -2, -7, 0, -7, -9, -4, -4, -8, -5, -13, 0, -4, -4, -7, -17, 0, -3, 0, -5, -1, -3, 0, -17, 0, -7, -6, -1, -2, -3, -3, 0
Offset: 1

Author

Ferenc Adorjan (fadorjan(AT)freemail.hu)

Keywords

Comments

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

Programs

  • PARI
    {/* The difference sequence values where the sequence of the largest "mixed" QR modulo the primes is non-monotonic */ lqxr_nm_d(to)=local(v=[],k,r,q,p,e=1,n=0,i=1); while(nr,k-=1); if(k-e<=0,v=concat(v,k-e);n+=1);e=k); print(i);print(v) }

A248222 Maximal gap between quadratic residues mod n.

Original entry on oeis.org

1, 1, 2, 3, 3, 2, 3, 4, 3, 3, 4, 5, 5, 3, 5, 7, 4, 3, 5, 7, 6, 4, 5, 8, 3, 5, 3, 7, 4, 5, 5, 8, 6, 4, 5, 9, 5, 5, 6, 11, 6, 6, 6, 8, 6, 5, 5, 12, 4, 3, 6, 8, 7, 3, 8, 9, 7, 4, 6, 11, 7, 5, 9, 8, 9, 6, 7, 13, 7, 5, 7, 12, 5, 5, 7, 8, 11, 6, 7, 15, 3, 6, 8, 12, 13, 6, 11, 16, 7, 6
Offset: 1

Author

David W. Wilson and M. F. Hasler, Oct 04 2014

Keywords

Comments

"Maximal gap between squares mod n" would be a less ambiguous definition.
The definition of quadratic residue modulo a nonprime varies from author to author. Sometimes, even when n is a prime, 0 is not counted as a quadratic residue. In this entry, an integer q is called a quadratic residue modulo n if it is congruent to a perfect square modulo n.
See A248376 for the variant with the additional restriction that the residue be coprime to the modulus. - M. F. Hasler, Oct 08 2014

Examples

			For n=7, the quadratic residues are all numbers congruent to 0, 1, 2, or 4 (mod 7), so the largest gap of 3 occurs for example between 4 = 2^2 (mod 7) and 7 = 0^2 (mod 7).
For n=16, the quadratic residues are the numbers congruent to 0, 1, 4 or 9 (mod 16), so the largest gap occurs between, e.g., 9 = 3^2 (mod 16) and 16 = 0^2 (mod 16).
		

References

  • K. Ireland and M. Rosen, A Classical Introduction to Modern Number Theory, Springer, 1982, p. 194. [Requires gcd(q,n)=1 for q to be a quadratic residue mod n.]
  • F. J. MacWilliams and N. J. A. Sloane, The Theory of Error-Correcting Codes, Elsevier-North Holland, 1978, p. 45.
  • G. B. Mathews, Theory of Numbers, 2nd edition. Chelsea, NY, p. 32. [Does not require gcd(q,n)=1.]
  • Ivan Niven and Herbert S. Zuckerman, An Introduction to the Theory of Numbers, New York: John Wiley, 2nd ed., 1966, p. 69. [Requires gcd(q,n)=1 for q to be a quadratic residue mod n.]
  • J. V. Uspensky and M. A. Heaslet, Elementary Number Theory, McGraw-Hill, NY, 1939, p. 270. [Does not require gcd(q,n)=1.]

Crossrefs

Programs

  • PARI
    (DD(v)=vecextract(v,"^1")-vecextract(v,"^-1")); a(n)=vecmax(DD(select(f->issquare(Mod(f,n)),vector(n*2,i,i))))

Extensions

Comments and references added by N. J. A. Sloane, Oct 04 2014
Showing 1-10 of 12 results. Next