Source: http://www.promath.fr/boutoille/3e/exercices/exos_2016/01_arithmetique.pdf