least and greatest solutions of equations over n