Source: https://www.maths-france.fr/Terminale/TerminaleS/ProblemesBac/AnnalesThematiques/Specialite/arithmetique/2015-centres-etrangers-exo4.pdf