k seems to be already bound in the second inequality and therefore "where k is the greatest integer for which..." is nonsense.