Source: https://www.lcps.org/cms/lib4/VA01000195/Centricity/Domain/18671/Factoring Special Cases.pdf