Source: http://www.edu.upmc.fr/maths/wassef_LM220/documents/arithmetique.pdf