Choose integers , , and a seed . Iterate and return . This gives a deterministic finite-state pseudorandom number generator with output in . A nonzero increment gives a mixed generator; gives a multiplicative generator. Its period is at most , but even a full period does not guarantee good multidimensional uniformity or statistical independence.
A linear congruential generator has period for every seed if and only if , every prime dividing divides , and implies . The coprimality of prevents the orbit from being trapped in a residue class; the multiplier conditions permit full-period lifting through each prime power. Combining the prime-power periods by the Chinese remainder theorem gives period . For , the multiplier criterion reduces to , together with . A positive increment alone is insufficient.

Articles by others on the same topic (1)

A Linear Congruential Generator (LCG) is a type of pseudo-random number generator algorithm that utilizes a linear congruential formula to produce a sequence of pseudo-random numbers. It is one of the oldest and simplest methods for generating random numbers and is widely used in computer simulations, statistical sampling, and various other applications that require random number generation.