%I #22 Oct 02 2017 02:12:07
%S 2,3,5,7,13,33,20,73,47,193,113,683,103,433,45,562,1313,10307,4013,
%T 12613,9133,10643,5537,31307,16727,50923,66463,195227,92237,229913,
%U 125,342763,2248
%N a(1)=2; thereafter, a(n) is the smallest number not occurring earlier such that Kronecker(a(k), a(n)) = -1 for the next n indices k = n+1, n+2, ..., 2n.
%C Kronecker(i,j) is an extension of the Jacobi symbol to all integers. The sequence with the condition Kronecker(a(k), a(n)) = -1/+1 is given by A247665.
%e a(1) = 2 because the next term is 3 and k(2,3) = -1;
%e a(2) = 3 because the next two terms are (5,7) => k(3,5) = -1 and k(3,7) = -1;
%e a(3) = 5 because the next three terms are (7,13,33) => k(5,7) = -1, k(5,13) = -1 and k(5,33) = -1.
%o (PARI) m=33; v=vector(m); u=vectorsmall(25000*m); for(n=1, m, for(i=2, 10^9, if(!u[i], for(j=(n+1)\2, n-1, if(kronecker(v[j], i)==1 || kronecker(v[j], i)==0, next(2))); v[n]= i; u[i]=1; break))); v
%Y Cf. A247665.
%K nonn,more
%O 1,1
%A _Michel Lagneau_, Nov 04 2014