Source: https://web.northeastern.edu/dummit/docs/numthy_2_modular_arithmetic.pdf