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.

A000229 a(n) is the least number m such that the n-th prime is the least quadratic nonresidue modulo m.

This page as a plain text file.
%I A000229 M2684 N1074 #77 Jul 22 2019 17:27:07
%S A000229 3,7,23,71,311,479,1559,5711,10559,18191,31391,422231,701399,366791,
%T A000229 3818929,9257329,22000801,36415991,48473881,175244281,120293879,
%U A000229 427733329,131486759,3389934071,2929911599,7979490791,36504256799,23616331489,89206899239,121560956039
%N A000229 a(n) is the least number m such that the n-th prime is the least quadratic nonresidue modulo m.
%C A000229 Note that a(n) is always a prime q > prime(n).
%C A000229 For n > 1, a(n) = prime(k), where k is the smallest number such that A053760(k) = prime(n).
%C A000229 One could make a case for setting a(1) = 2, but a(1) = 3 seems more in keeping with the spirit of the sequence.
%C A000229 a(n) is the smallest odd prime q such that prime(n)^((q-1)/2) == -1 (mod q) and b^((q-1)/2) == 1 (mod q) for every natural base b < prime(n). - _Thomas Ordowski_, May 02 2019
%D A000229 N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
%D A000229 N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
%H A000229 N. J. A. Sloane, <a href="/A000229/b000229.txt">Table of n, a(n) for n = 1..38</a> (from the web page of Tomás Oliveira e Silva)
%H A000229 H. J. Godwin, <a href="http://dx.doi.org/10.1017/S0305004100039025">On the least quadratic non-residue</a>, Proc. Camb. Phil. Soc., 61 (3) (1965), 671-672.
%H A000229 A. J. Hanson, G. Ortiz, A. Sabry and Y.-T. Tai, <a href="http://arxiv.org/abs/1305.3292">Discrete Quantum Theories</a>, arXiv preprint arXiv:1305.3292 [quant-ph], 2013.
%H A000229 A. J. Hanson, G. Ortiz, A. Sabry, Y.-T. Tai, <a href="http://www.cs.indiana.edu/~sabry/papers/saskatoon-talk.pdf">Discrete quantum theories</a>, (a different version). (To appear in J. Phys. A: Math. Theor., 2014).
%H A000229 Tomás Oliveira e Silva, <a href="http://sweet.ua.pt/tos/p_roots.html">Least primitive root of prime numbers</a>
%H A000229 Hans Salié, <a href="http://dx.doi.org/10.1002/mana.19650290109">Uber die kleinste Primzahl, die eine gegebene Primzahl als kleinsten positiven quadratischen Nichtrest hat</a>, Math. Nachr. 29 (1965) 113-114.
%H A000229 Yu-Tsung Tai, <a href="https://scholarworks.iu.edu/dspace/bitstream/handle/2022/23178/dissertation.pdf">Discrete Quantum Theories and Computing</a>, Ph.D. thesis, Indiana University (2019).
%e A000229 a(2) = 7 because the second prime is 3 and 3 is the least quadratic nonresidue modulo 7, 14, 17, 31, 34, ... and 7 is the least of these.
%t A000229 leastNonRes[p_] := For[q = 2, True, q = NextPrime[q], If[JacobiSymbol[q, p] != 1, Return[q]]]; a[1] = 3; a[n_] := For[pn = Prime[n]; k = 1, True, k++, an = Prime[k]; If[pn == leastNonRes[an], Print[n, " ", an];  Return[an]]]; Array[a, 20] (* _Jean-François Alcover_, Nov 28 2015 *)
%Y A000229 Cf. A020649, A025021, A053760, A307809. For records see A133435.
%Y A000229 Differs from A002223, A045535 at 12th term.
%K A000229 nonn,nice
%O A000229 1,1
%A A000229 _N. J. A. Sloane_
%E A000229 Definition corrected by Melvin J. Knight (MELVIN.KNIGHT(AT)ITT.COM), Dec 08 2006
%E A000229 Name edited by _Thomas Ordowski_, May 02 2019