%I #23 Mar 10 2021 17:29:11
%S 2,2,3,3,2,2,3,3,2,2,5,5,2,2,3,3,2,2,3,3,2,2,5,7,2,2,3,3,2,2,3,3,2,2,
%T 7,5,2,2,3,3,2,2,3,3,2,2,5,5,2,2,3,3,2,2,3,3,2,2,7,11,2,2,3,3,2,2,3,3,
%U 2,2,5,5,2,2,3,3,2,2,3,3,2,2,5,13,2,2,3,3,2,2,3,3,2,2,7,5,2,2,3,3,2,2
%N a(n) = the least k >= 1 for which the Jacobi symbol J(k,2n+1) is not +1 (thus is either 0 or -1).
%C If we instead list the least k >= 1, for which Jacobi symbol J(k,2n+1) is 0, we get A090368.
%C It is easy to see that every term is prime. Because the Jacobi symbol is multiplicative as J(ab,m) = J(a,m)*J(b,m) and if for every index i>=1 and < x, J(i,m)=1, then if J(x,m) is 0 or -1, x cannot be composite (say y*z, with both y and z less than x), as then either J(y,m) or J(z,m) would be non-one, which contradicts our assumption that x is the first index where non-one value appears. Thus x must be prime.
%H Indranil Ghosh and A.H.M. Smeets, <a href="/A112046/b112046.txt">Table of n, a(n) for n = 1..20000</a> (first 1000 terms from Indranil Ghosh)
%F a(n) = A112050(n) + 1 = A000040(A112049(n)).
%o (PARI) A112046(n) = for(i=1, (2*n), if((kronecker(i, (n+n+1)) < 1), return(i))); \\ _Antti Karttunen_, May 26 2017
%o (Python)
%o from sympy import jacobi_symbol as J
%o def a(n):
%o i=1
%o while True:
%o if J(i, 2*n + 1)!=1: return i
%o else: i+=1
%o print([a(n) for n in range(1, 103)]) # _Indranil Ghosh_, May 11 2017
%Y One more than A112050.
%Y Bisections: A112047, A112048, and their difference: A112053.
%Y Cf. A000040, A053760, A053761, A090368, A112049, A112060, A112070, A268829, A286465, A286466.
%K nonn
%O 1,1
%A _Antti Karttunen_, Aug 27 2005