Many random number generators like Linear Congruential Generator and the Marsenne Twister generator use prime numbers.
Is it to capitalize on the fact that the gaps between the primes are thought of to be random?
Many random number generators like Linear Congruential Generator and the Marsenne Twister generator use prime numbers.
Is it to capitalize on the fact that the gaps between the primes are thought of to be random?
Copyright © 2021 JogjaFile Inc.
No. It's because when the modulus is composite you can have some weird algebraic phenomena take place.
If $p$ is prime then every linear polynomial $f(x) \equiv ax + b \bmod p$ where $a \not\equiv 0 \bmod p$ is a permutation of the integers mod $p$ as $x$ runs over $0, 1, \ldots, p-1$. For composite $m$, linear polynomials mod $m$ don't take on all values mod $m$ for $a$ in $1, \ldots, m-1$ that have a factor in common with $m$.