Source: https://archimede.mat.ulaval.ca/amq/bulletins/mar09/Enigmes_et_jeux(mars09).pdf