Source: https://agreg-maths.fr/uploads/versions/7/entiers_Gauss_scourte.pdf