Source: https://www.fmf.uni-lj.si/~lavric/Tattersall - Elementary number theory in nine chapters.pdf