Source: http://www.joseouin.fr/math-tice/banque/exercices_arithmetique.pdf