Properties of the gimel function and a classification of singular cardinals