Skip to content

Esta página también está en español.

Léela en español

このページは日本語でも読めます。

日本語で読む

本页也有简体中文版本。

阅读简体中文版本

Modular inverse (modular_inverse)

The inverse of a whole number modulo another.

How to write it

modular_inverse(a, m)

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

Examples

  • 3−1 mod 7=5\displaystyle 3^{-1} \bmod 7 = 5
    modular_inverse(3, 7)

    In the solver, modular_inverse(3, 7) gives 5.

    Open in the solver
  • moebius_mu

    Moebius function: 0 if a square divides n, else 1 or -1 by the parity of its prime factors.

  • lucas_l

    The n-th Lucas number.

  • multinomial

    Multinomial coefficient: the ways to split n items into groups of the given sizes.

  • jacobi_symbol

    Jacobi symbol (a/n), for an odd positive n.

  • multiplicative_order

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

  • is_square_free

    Test whether no square greater than 1 divides a whole number.