Source: http://gery.huvent.pagesperso-orange.fr/irem/exos_arithmetique.pdf