This function returns the number of generators ofI.
This is more direct, therefore efficient, than writing len(gens(I)),
because it does not create the temporary list gens(I).
Example
/**/ use R ::= QQ[x,y,z];
/**/ I := ideal(indets(R))^40;
/**/ NumGens(I);
861