Source: http://herrmann.perso.math.cnrs.fr/test-arithmetique-corr.pdf