Source: https://www.imo.universite-paris-saclay.fr/~daniel.perrin/CAPES/arithmetique/EntiersCAPES.pdf