bridge/class-master/depend/pari/src/basemath/mftrace.c
/* quadratic non-residues mod p; p odd prime, p^2 fits in a long */
quadratic non-residues mod p; p odd prime, p^2 fits in a long
quadratic non - residues mod p ; p odd prime p^2 fits in a long
static GEN
non_residues(long p)
{
  long i, j, p2 = p >> 1;
  GEN v = cgetg(p2+1, t_VECSMALL), w = const_vecsmall(p-1, 1);
  for (i = 2; i <= p2; i++) w[(i*i) % p] = 0; 
  for (i = 2, j = 1; i < p; i++) if (w[i]) v[j++] = i;
  return v;
}
static GEN non_residues ( long p ) { long i , j , p2 = p >> 1 ; GEN v = cgetg ( p2 + 1 , t_VECSMALL ) , w = const_vecsmall ( p - 1 , 1 ) ; for ( i = 2 ; i <= p2 ; i ++ ) w [ ( i * i ) % p ] = 0 ; for ( i = 2 , j = 1 ; i < p ; i ++ ) if ( w [ i ] ) v [ j ++ ] = i ; return v ; }
quadratic non-residues mod p; p odd prime, p^2 fits in a long
quadratic non - residues mod p ; p odd prime p^2 fits in a long
/* no need to check 1 */