Modulo arithmetic identifies values by their remainders after division by a specified modulus. Clock arithmetic gives the intuition: 10 plus 3 hours is 1 modulo 12. section 2.2.2
In a linear congruential generator, each state is updated as Xₙ₊₁ = (aXₙ + c) mod m. This reduction keeps outputs within the modulus and supports parameter-recovery attacks. section 2.2.2
Inverses and implementation hazards
The multiplicative inverse of 7 modulo 12 is 7 because 7 × 7 = 49 ≡ 1 mod 12. In Go, -16 % 7 returns -2 rather than 5, so code must normalize negative results. section 2.2.2
Equation 2.3
\[X_{n+1} = \left( a X_n + c \right)\bmod m \label{equation:lcg}\]Use the recurrence equation to connect modular reduction with the state transition of a linear congruential generator. section 2.2.2


