residue class and polynimials
additional tests: factmodd