A385338 Consecutive states of the linear congruential pseudo-random number generator (421*s + 17117) mod 81000 when started at s=1.
1, 17538, 29615, 11032, 44589, 78086, 5323, 71100, 61217, 31474, 64671, 27608, 57085, 73902, 25859, 49756, 66393, 23570, 58087, 9744, 69341, 49678, 33555, 49772, 73129, 24426, 13463, 15040, 30957, 9014, 5011, 20748, 4025, 10642, 42399, 47096, 80533, 63510
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(421*a(n-1)+17117, 81000)) end: seq(a(n), n=1..44); # after Alois P. Heinz
-
Mathematica
NestList[Mod[421*# + 17117, 81000] &, 1, 50] (* after Paolo Xausa *)
Formula
a(n) = (421 * a(n-1) + 17117) mod 81000.
Comments