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
modular_inverse(3, 7)In the solver,
Open in the solvermodular_inverse(3, 7)gives5.
Related functions
- 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.