Inversive congruential generator
Inversive congruential generators are a type of nonlinear congruential pseudorandom number generator, which use the modular multiplicative inverse (if it exists) to generate the next number in a sequence. The standard formula for an inversive congruential generator, modulo some prime q is: x 0 = seed , {\displaystyle x_{0}={\text{seed}},} x i + 1 = { ( a x i − 1 + c ) mod q if x i ≠ 0 , c if x i = 0.
Source: Wikipedia — Inversive congruential generator (CC BY-SA 4.0)