This site is supported by donations to The OEIS Foundation.



Please make a donation to keep the OEIS running. We are now in our 55th year. In the past year we added 12000 new sequences and reached 8000 citations (which often say "discovered thanks to the OEIS"). We need to raise money to hire someone to manage submissions, which would reduce the load on our editors and speed up editing.
Other ways to donate

(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A053760 Smallest positive quadratic nonresidue modulo p, where p is the n-th prime. 21


%S 2,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,

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

%U 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,2,2,2

%N Smallest positive quadratic nonresidue modulo p, where p is the n-th prime.

%C Assuming the Generalized Riemann Hypothesis, Montgomery proved a(n) << (log p(n))^2, meaning that there is a constant c such that |a(n)| <= c*(log p(n))^2. - _Jonathan Vos Post_, Jan 06 2007

%C a(n) < 1 + sqrt(p), where p is the n-th prime (Theorem 3.9 in Niven, Zuckerman, and Montgomery). - _Jonathan Sondow_, May 13 2010

%C Treviño proves that a(n) < 1.1 p^(1/4) log p for n > 2 where p is the n-th prime. - _Charles R Greathouse IV_, Dec 06 2012

%C a(n) is always a prime, because if x*y is a nonresidue, then x or y must also be a nonresidue. - _Jonathan Sondow_, May 02 2013

%C a(n) is the smallest prime q such that the congruence x^2 == q (mod p) has no solution 0 < x < p, where p = prime(n). For n > 1, a(n) is the smallest base b such that b^((p-1)/2) == -1 (mod p), where odd p = prime(n). - _Thomas Ordowski_, Apr 24 2019

%D Steven R. Finch, Mathematical Constants, Cambridge, 2003, pp. 94-98.

%D H. L. Montgomery, Topics in Multiplicative Number Theory, 3rd ed., Lecture Notes in Mathematics, Vol. 227 (1971), MR 49:2616.

%D Ivan Niven, Herbert S. Zuckerman, and Hugh L. Montgomery, An Introduction to the Theory Of Numbers, Fifth Edition, John Wiley and Sons, Inc., NY 1991, p. 147.

%D P. Ribenboim, The New Book of Prime Number Records, 3rd ed., Springer-Verlag 1996; Math. Rev. 96k:11112.

%H T. D. Noe, <a href="/A053760/b053760.txt">Table of n, a(n) for n = 1..10000</a>

%H R. Baillie and S. S. Wagstaff, <a href="http://mpqs.free.fr/LucasPseudoprimes.pdf">Lucas pseudoprimes</a>, Math. Comp. 35 (1980) 1391-1417; Math. Rev. 81j:10005.

%H P. Erdős, <a href="http://www.renyi.hu/~p_erdos/1961-23.pdf">Remarks on number theory. I.</a>, Mat. Lapok 12 (1961) 10-17; Math. Rev. 26 #2410.

%H Steven R. Finch, <a href="http://www.people.fas.harvard.edu/~sfinch/constant/hdmrd/jacobi.html">Quadratic Residues</a> [Broken link]

%H Steven R. Finch, <a href="http://web.archive.org/web/20010208112444/http://www.mathsoft.com/asolve/constant/hdmrd/jacobi.html">Quadratic Residues</a> [From the Wayback machine]

%H K. Matthews, <a href="http://www.numbertheory.org/php/leastqnr.html">Finding n(p), the least quadratic non-residue (mod p)</a>

%H Enrique Treviño, <a href="http://campus.lakeforest.edu/trevino/LeastNonResidue.pdf">The least k-th power non-residue</a>, 2011 preprint; J. Number Theory, 149, 201-224 (2015).

%H Eric Weisstein's World of Mathematics, <a href="http://mathworld.wolfram.com/QuadraticNonresidue.html">Quadratic Nonresidue</a>

%F a(n) = A020649(prime(n)) for n > 1. - _Thomas Ordowski_, Apr 24 2019

%e The 5th prime is 11, and the positive quadratic residues mod 11 are 1^2 = 1, 2^2 = 4, 3^2 = 9, 4^2 = 5 and 5^2 = 3. Since 2 is missing, a(5) = 2.

%e The only positive quadratic redidue mod 2 is 1, so a(1)=2.

%t Table[ p = Prime[n]; First[ Select[ Range[p], JacobiSymbol[#, p] != 1 &]], {n, 1, 100}] (* _Jonathan Sondow_, Mar 03 2013 *)

%o (PARI) residue(n,m)={local(r);r=0;for(i=0,floor(m/2),if(i^2%m==n,r=1));r

%o A053760(n)={local(r,m);r=0;m=0;while(r==0,m=m+1;if(!residue(m,prime(n)),r=1));m} \\ Michael B. Porter, May 02 2010

%o (PARI) qnr(p)=my(m);while(1,if(!issquare(Mod(m++,p)),return(m)))

%o a(n)=if(n>1,qnr(prime(n)),2) \\ _Charles R Greathouse IV_, Feb 27 2013

%Y Cf. A000229, A020649.

%K nonn

%O 1,1

%A _Steven Finch_, Apr 05 2000

%E More terms from _James A. Sellers_, Apr 08 2000

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified December 6 16:24 EST 2019. Contains 329808 sequences. (Running on oeis4.)