Let O be an orbit in Z n of a finitely generated subgroup of GL n (Z) whose Zariski closure Zcl( ) is suitably large (e.g. isomorphic to SL 2 ). We develop a Brun combinatorial sieve for estimating the number of points on O at which a fixed integral polynomial is prime or has few prime factors, and discuss applications to classical problems, including Pythagorean triangles and integral Apollonian packings. A fundamental role is played by the expansion property of the "congruence graphs" that we associate with O. This expansion property is established when Zcl( ) = SL 2 , using crucially sum-product theorem in Z/qZ for q square-free.