Source: http://www.jaicompris.com/lycee/math/arithmetique/divisibilite/theoreme-gauss-exercice.pdf