Source: http://www.est-usmba.ac.ma/ALGORITHME/res/TD_systeme Numeration (Correction).pdf