--- from: http://rosettacode.org/wiki/Multiplicative_order note: Discrete math