Order of a residue class

Use only in the MuPAD Notebook Interface.

This functionality does not run in MATLAB.


numlib::order(a, m)


numlib::order(a,m) returns the order of the residue class modulo m of a in the group of units modulo m if a and m are coprime.

numlib::order(a,m) returns the function call with its arguments evaluated if a or m is not a number.

numlib::order returns an error if one of the arguments evaluates to a number of wrong type.


Example 1

We compute the order of the residue class of 23 in the unit group modulo 2161:

numlib::order(23, 2161)

Example 2

We compute the order of all elements in the unit group modulo 13:

map([$ 1..12],numlib::order,13)

Example 3

The residue class of 7 is not a unit in the ring modulo 21:




An integer


A natural number

Return Values

numlib::order(a,m) returns a natural number if a is coprime to m, and FAIL if a is not coprime to m.


numlib::order uses ifactor and numlib::phi.

See Also

MuPAD Functions

Was this topic helpful?