Source: https://gery.huvent.pagesperso-orange.fr/irem/nbpremier_partie2.pdf