Using the relation between the problem of counting irreducible polynomials over finite fields with some prescribed coefficients to the problem of counting rational points on curves over finite fields whose function fields are subfields of cyclotomic function fields, we count the number of generators of finite fields with powers of trace zero up to some point, answering a question of Z. Reichstein, and give a few other applications of this method.