Inspired by my project to create and solve a Sudoku using C. Unfortunately, the functions provided by the C programming language: srand and rand result in many repeats. I know that C++ could be used but I wish for the code to have minimal overheads. So, this project researched algorithms for a random number generator before coding in C. The solution has been implemented into the Sudoku project!
Research led me to use the Lehmer Random Number Generator associated with the Linear Congruential Generator Algorithm:
Xk+1 = a · Xk mod m
where:
a = 48271
X0 = 6700417 (coprime to m - only divisor of both is 1)
m = 231-1 (prime number)