OFFSET
1,1
COMMENTS
From Jianing Song, Feb 14 2019: (Start)
a(n) is necessarily prime. Otherwise, if a(n) is not prime, we have (D/p) = 0 or 1 for all prime divisors p of a(n), so (D/a(n)) must be 0 or 1 too, a contradiction.
a(n) is the least inert prime in the imaginary quadratic field with discriminant D, D = -A003657(n). (End)
LINKS
Amiram Eldar, Table of n, a(n) for n = 1..10000
S. R. Finch, Average least nonresidues, December 4, 2013. [Cached copy, with permission of the author]
P. Pollack, The average least quadratic nonresidue modulo m and other variations on a theme of Erdős, J. Number Theory 132 (2012) 1185-1202.
FORMULA
EXAMPLE
A003657(4) = 8, (-8/5) = -1, (-8/3) = 1 and (-8/2) = 0, so a(4) = 5.
MATHEMATICA
nMax = 200; FundamentalDiscriminantQ[n_] := n != 1 && (Mod[n, 4] == 1 || ! Unequal[Mod[n, 16], 8, 12]) && SquareFreeQ[n/2^IntegerExponent[n, 2]]; discrims = Select[-Range[4 nMax], FundamentalDiscriminantQ]; f[d_] := For[k = 1, True, k++, If[FreeQ[{0, 1}, KroneckerSymbol[d, k]], Return[k] ] ]; a[n_] := f[discrims[[n]]]; Table[a[n], {n, 1, nMax}] (* Jean-François Alcover, Nov 05 2016, after Robert G. Wilson v *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Steven Finch, Dec 02 2013
EXTENSIONS
Name simplified by Jianing Song, Feb 14 2019
STATUS
approved