login
A385459
Consecutive internal states of the linear congruential pseudo-random number generator (3877*s + 29573) mod 139968 when started at 1.
2
1, 33450, 104855, 85336, 132861, 49430, 53491, 121572, 91961, 63874, 65679, 65264, 135925, 31278, 82091, 9148, 84465, 115226, 122887, 11400, 137453, 76678, 18147, 121556, 29929, 30834, 40319, 2080, 115557, 6494, 12571, 58476, 132833, 80842, 65655, 112184
OFFSET
1,2
COMMENTS
Periodic with period 139968.
Described in Numerical Recipes as a "quick and dirty" generator.
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).
FORMULA
a(n) = (3877*a(n-1) + 29573) mod 139968.
MAPLE
a:= proc(n) option remember; `if`(n<2, n,
irem(3877*a(n-1)+29573, 139968))
end:
seq(a(n), n=1..45); # after Alois P. Heinz
MATHEMATICA
NestList[Mod[3877*# + 29573, 139968] &, 1, 50]
CROSSREFS
Sequence in context: A233751 A205212 A206220 * A069303 A235678 A235448
KEYWORD
nonn,easy
AUTHOR
Sean A. Irvine, Jun 29 2025
STATUS
approved