def modp_reductions(f, p, prec=None): K = f.base_ring() g = f.q_expansion(prec) return [g.change_ring(P.residue_field()) for P, e in K.factor(p)]
f = CuspForms(23).newforms('a')[0] modp_reductions(f, 5) modp_reductions(f, 7) modp_reductions(f, 11)