A Congruence Generator in the form .


Period

The period for this sequence is , hence this sequence cannot take more than times before it repeats, hence you should choose a very large .

Pattern goals

We do not want an obvious pattern between numbers or a zero as after 0 the sequence will continue to be 0.

A example of a combination of convenient and for calculation on a computer with a sufficiently large period are and .


Examples

,