Source: http://web64.ac-bordeaux.fr/fileadmin/fichiers/circos/ustaritz/Mathematiques/Numeration_et_resolution_de_problemes.pdf