Source: https://www.maths-france.fr/Terminale/TerminaleS/Cours/20-arithmetique.pdf