Source: https://martelli.netlify.app/cours/07_arithmetique_denombrement.pdf