MultiplicativeOrder[k, n] gives the multiplicative order of k modulo n, defined as the smallest integer such that .
MultiplicativeOrder[k, n, , , ... ] gives the generalized multiplicative order of k modulo n, defined as the smallest integer such that for some .
Integer mathematical function (see Section A.3.10).
MultiplicativeOrder returns unevaluated if there is no integer satisfying the necessary conditions.
See The Mathematica Book: Section 3.2.4.
See also: EulerPhi, PowerMod, CarmichaelLambda, RealDigits.