Source: https://www.math.univ-paris13.fr/~boyer/enseignement/nombre/09/td3.pdf