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 A063988 #36 Jul 02 2025 16:02:01 %S A063988 2,2,3,3,5,6,2,6,7,8,10,2,5,6,7,8,11,3,5,6,7,10,11,12,14,2,3,8,10,12, %T A063988 13,14,15,18,5,7,10,11,14,15,17,19,20,21,22,2,3,8,10,11,12,14,15,17, %U A063988 18,19,21,26,27,3,6,11,12,13,15,17,21,22,23,24,26,27,29,30,2,5,6,8,13,14 %N A063988 Triangle in which n-th row gives quadratic non-residues modulo the n-th prime. %D A063988 Albert H. Beiler, Recreations in the theory of numbers, New York, Dover, (2nd ed.) 1966. See Table 82 at p. 202. %H A063988 T. D. Noe, <a href="/A063988/b063988.txt">Rows n=2..100 of triangle, flattened</a> %e A063988 Mod the 5th prime, 11, the quadratic residues are 1,3,4,5,9 and the non-residues are 2,6,7,8,10. %e A063988 Triangle begins: %e A063988 2; %e A063988 2, 3; %e A063988 3, 5, 6; %e A063988 2, 6, 7, 8, 10; %e A063988 ... %p A063988 with(numtheory): for n from 1 to 20 do for j from 1 to ithprime(n)-1 do if legendre(j, ithprime(n)) = -1 then printf(`%d,`,j) fi; od: od: %t A063988 row[n_] := Select[p = Prime[n]; Range[p - 1], JacobiSymbol[#, p] == -1 &]; Table[row[n], {n, 2, 12}] // Flatten (* _Jean-François Alcover_, Oct 17 2012 *) %o A063988 (PARI) residue(n,m)={local(r);r=0;for(i=0,floor(m/2),if(i^2%m==n,r=1));r} %o A063988 isA063988(n,m)=!residue(n,prime(m)) \\ _Michael B. Porter_, May 07 2010 %o A063988 (PARI) tabf(nn) = {for(n=1, prime(nn), p = prime(n); for (i=2, p-1, if (kronecker(i, p) == -1, print1(i, ", "));); print(););} \\ _Michel Marcus_, Jul 19 2013 %o A063988 (Python) %o A063988 from sympy import jacobi_symbol as J, prime %o A063988 def a(n): %o A063988 p=prime(n) %o A063988 return [i for i in range(1, p) if J(i, p)==-1] %o A063988 print([a(n) for n in range(2, 13)]) # _Indranil Ghosh_, May 27 2017 %Y A063988 Cf. A063987. %K A063988 nonn,tabf,nice,easy %O A063988 2,1 %A A063988 Suggested by _Gary W. Adamson_, Sep 18 2001 %E A063988 More terms from _James Sellers_, Sep 25 2001