Commutative rings with acc on n-generated ideals