test inverse_mod