Congruence and Modular Arithmetic
Modular Multiplicative Inverse
Then, by definition, the modular inverse of is .
Consider the following equation (a LDE) with unknown :
Competitive Programming
Needed to learn this after messing up this question https://codeforces.com/contest/2008/problem/F
Resources
Modular Inverse % MOD
This is used for Binomial Coefficient % MOD.
Using EEA without MOD
If you need the original one without modulo, use EEA.
This is calculated using EEA, where we have the function
MATH135
Inverses in (INV )
Let be an integer with . The element in has a multiplicative inverse if and only if . Moreover, when , the multiplicative inverse is unique.
Inverses in (INV )
For all prime numbers and non-zero elements in , the multiplicative inverse exists and is unique.