Source: http://www.amemath.o2switch.net/ame_mathematique2/exo_ts_spe/congruences.pdf