On the number of generators of an ideal