%I
%S 4,2,3,3,2,4,2,4,2,3,2,4,2,4,3,3,4,2,2,2,3,2,2,4,2,3,3,2,2,3,2,4,4,2,
%T 3,4,2,4,3,3,2,2,4,2,4,2,3,3,2,2,2,3,2,2,4,2,3,2,4,4,4,2,2,4,4,2,3,3,
%U 2,2,2,3,4,2,4,3,2,2,3,3,2,2,2,3,2,2,4,2,3,2,2,3,4,2,4,2,4,3
%N a(n) is the smallest quadratic residue > 1 modulo prime(n), for n > 2.
%C There is no quadratic residue > 1 modulo the first or 2nd prime, so the sequence begins with a(3).
%H Wikipedia, <a href="http://en.wikipedia.org/wiki/Quadratic_residue">Quadratic residue</a>
%H Wikipedia, <a href="http://en.wikipedia.org/wiki/Quadratic_reciprocity">Quadratic reciprocity</a>
%F a(n) = 2 or 3 or 4 according as prime(n) == 1,7,9,15,17,23 or 11,13 or 3,5,19,21 (mod 24), respectively, for n > 2, by the quadratic reciprocity law and its supplements.
%e The quadratic residues modulo prime(3) = 5 are 1 and 4, so a(3) = 4.
%t Flatten[Table[ Extract[Flatten[ Position[Table[JacobiSymbol[i, Prime[n]], {i, 1, Prime[n]  1}], 1]], {2}], {n, 3, 100}]]
%Y Cf. A063987 Triangle in which the nth row gives the quadratic residues modulo prime(n), A053760 Smallest positive quadratic nonresidue modulo prime(n).
%K easy,nonn
%O 3,1
%A _Jonathan Sondow_, May 16 2010
