This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A177864 #13 Jun 14 2022 17:48:48 %S A177864 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 A177864 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 A177864 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 A177864 a(n) is the smallest nontrivial quadratic residue modulo prime(n), for n >= 3. %C A177864 There is no quadratic residue > 1 modulo the first or 2nd prime, so the sequence begins with a(3). %H A177864 Wikipedia, <a href="http://en.wikipedia.org/wiki/Quadratic_residue">Quadratic residue</a> %H A177864 Wikipedia, <a href="http://en.wikipedia.org/wiki/Quadratic_reciprocity">Quadratic reciprocity</a> %F A177864 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 A177864 The quadratic residues modulo prime(3) = 5 are 1 and 4, so a(3) = 4. %t A177864 Flatten[Table[ Extract[Flatten[ Position[Table[JacobiSymbol[i, Prime[n]], {i, 1, Prime[n] - 1}], 1]], {2}], {n, 3, 100}]] %o A177864 (PARI) a(n,p=prime(n))=[2,0,0,0,4,0,2,0,0,0,3,0,3,0,0,0,2,0,4,0,0,0,2][p%24] \\ _Charles R Greathouse IV_, Jun 14 2022 %Y A177864 Cf. A063987 (triangle in which the n-th row gives the quadratic residues modulo prime(n)), A053760 (smallest positive quadratic nonresidue modulo prime(n)). %K A177864 easy,nonn %O A177864 3,1 %A A177864 _Jonathan Sondow_, May 16 2010