OFFSET
1,1
COMMENTS
Note that a(n) is always a prime q > prime(n).
For n > 1, a(n) = prime(k), where k is the smallest number such that A053760(k) = prime(n).
One could make a case for setting a(1) = 2, but a(1) = 3 seems more in keeping with the spirit of the sequence.
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
REFERENCES
N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
LINKS
N. J. A. Sloane, Table of n, a(n) for n = 1..38 (from the web page of Tomás Oliveira e Silva)
H. J. Godwin, On the least quadratic non-residue, Proc. Camb. Phil. Soc., 61 (3) (1965), 671-672.
A. J. Hanson, G. Ortiz, A. Sabry and Y.-T. Tai, Discrete Quantum Theories, arXiv preprint arXiv:1305.3292 [quant-ph], 2013.
A. J. Hanson, G. Ortiz, A. Sabry, Y.-T. Tai, Discrete quantum theories, (a different version). (To appear in J. Phys. A: Math. Theor., 2014).
Tomás Oliveira e Silva, Least primitive root of prime numbers
Hans Salié, Uber die kleinste Primzahl, die eine gegebene Primzahl als kleinsten positiven quadratischen Nichtrest hat, Math. Nachr. 29 (1965) 113-114.
Yu-Tsung Tai, Discrete Quantum Theories and Computing, Ph.D. thesis, Indiana University (2019).
EXAMPLE
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.
MATHEMATICA
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 *)
CROSSREFS
KEYWORD
nonn,nice
AUTHOR
EXTENSIONS
Definition corrected by Melvin J. Knight (MELVIN.KNIGHT(AT)ITT.COM), Dec 08 2006
Name edited by Thomas Ordowski, May 02 2019
STATUS
approved