A385336 Consecutive states of the linear congruential pseudo-random number generator (1541*s + 2957) mod 14000 when started at s=1.
1, 4498, 4375, 10832, 7069, 4286, 13683, 4460, 1817, 2954, 5071, 5368, 1045, 3302, 9339, 2356, 7553, 8130, 1287, 12224, 10141, 6238, 11715, 9772, 11609, 426, 1423, 11800, 757, 7494, 1211, 7108, 8385, 2242, 13879, 12496, 9293, 1470, 227, 2764, 6281, 7978, 5055
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(1541*a(n-1)+2957, 14000)) end: seq(a(n), n=1..44); # after Alois P. Heinz
-
Mathematica
NestList[Mod[1541*# + 2957, 14000] &, 1, 50] (* after Paolo Xausa *)
Formula
a(n) = (1541 * a(n-1) + 2957) mod 14000.
Comments