A385337 Consecutive states of the linear congruential pseudo-random number generator (1291*s + 4621) mod 21870 when started at s=1.
1, 5912, 4383, 20614, 1505, 1146, 18817, 21668, 6279, 18910, 10511, 14922, 1453, 21494, 345, 12616, 20597, 1428, 11089, 17540, 13311, 21172, 173, 9264, 1555, 86, 6297, 20278, 5129, 21420, 14161, 3152, 6033, 7504, 3875, 20886, 2737, 17018, 17379, 2290, 8561
Offset: 1
References
- William H. Press, Saul A. Teukolsky, William T. Vetterling, and Brian P. Flannery, Numerical Recipes in C (2nd ed), Cambridge University Press, 1999 (see p. 285).
Links
Programs
-
Maple
a:= proc(n) option remember; `if`(n<2, n, irem(1291*a(n-1)+4621, 21870)) end: seq(a(n), n=1..44); # after Alois P. Heinz
-
Mathematica
NestList[Mod[1291*# + 4621, 21870] &, 1, 50] (* after Paolo Xausa *)
Formula
a(n) = (1291 * a(n-1) + 4621) mod 21870.
Comments