# multiplicative_order function

The least power of a number that is 1 modulo another.

## How to write it

### multiplicative_order(a, m)

**a**

The number. Takes a whole number.

**m**

The modulus, coprime to a. Takes a whole number.

## Examples

- $\displaystyle \operatorname{multiplicative\_order}(2, 7) = 3$

  `multiplicative_order(2, 7)`

  In the solver, `multiplicative_order(2, 7)` gives `3`.

  [Open in the solver](https://hilberon.com/?q=multiplicative_order%282%2C%207%29)

## Related functions

- [next_prime](https://hilberon.com/library/next_prime)

  The least prime greater than a number.
- [multinomial](https://hilberon.com/library/multinomial)

  Multinomial coefficient: the ways to split n items into groups of the given sizes.
- [nth_prime](https://hilberon.com/library/nth_prime)

  The n-th prime, counting 2 as the first.
- [moebius_mu](https://hilberon.com/library/moebius_mu)

  Moebius function: 0 if a square divides n, else 1 or -1 by the parity of its prime factors.
- [partitions_p](https://hilberon.com/library/partitions_p)

  How many ways a whole number is a sum of positive whole numbers, in any order of terms.
- [modular_inverse](https://hilberon.com/library/modular_inverse)

  The inverse of a whole number modulo another.

---
Source: https://hilberon.com/library/multiplicative_order
