%I #4 Apr 16 2014 05:40:40
%S 3,2,2,3,2,2,2,2,5,2,3,2,2,2,5,2,2,2,2,7,3,3,2,3,2,2,3,2,2,2,3,2,2,2,
%T 2,3,2,2,5,2,2,2,7,2,2,3,2,3,2,2,3,7,2,2,2,5,2,3,2,2,2,2,2,11,2,2,2,3,
%U 2,2,2,7,3,2,2,5,2,2,2,2,2,2,7,2,3,2,2
%N Least k such that k^m == -1 (mod prime(n)) has a solution for some m.
%C Looking at sequences A240657-A240665, one sees many 0 terms. This sequence finds the least k having a solution. Is the least k always prime?
%H T. D. Noe, <a href="/A240666/b240666.txt">Table of n, a(n) for n = 1..10000</a>
%t Table[p = Prime[n]; k = 2; While[s = Select[Range[p/2], PowerMod[k, #, p] == p - 1 &, 1]; s == {}, k++]; k, {n, 100}]
%Y Cf. A240657-A240665.
%K nonn
%O 1,1
%A _T. D. Noe_, Apr 15 2014