Source: http://www.math.ualberta.ca/~isaac/math228/s07/congruences.pdf