how to find successor and predecessor of a number