Mathematical analysis of the mutarotation of sugars