login
A385279
Consecutive states of the linear congruential pseudo-random number generator (625*s + 6571) mod 31104 when started at s=1.
3
1, 7196, 25095, 14530, 5453, 24360, 21715, 17102, 26649, 21556, 11039, 858, 14053, 18368, 9195, 30310, 7985, 20556, 8119, 10994, 3837, 9688, 27395, 21246, 3913, 26084, 10575, 21898, 7061, 2928, 1435, 1430, 29409, 4732, 9191, 27810, 685, 30344, 29235, 20398
OFFSET
1,2
COMMENTS
Periodic with period 31104.
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) = (625 * a(n-1) + 6571) mod 31104.
MAPLE
a:= proc(n) option remember; `if`(n<2, n,
irem(625*a(n-1)+6571, 31104))
end:
seq(a(n), n=1..44); # after Alois P. Heinz
MATHEMATICA
NestList[Mod[625*# + 6571, 31104] &, 1, 50] (* after Paolo Xausa *)
CROSSREFS
Sequence in context: A064979 A348807 A204480 * A035906 A190114 A239566
KEYWORD
nonn,easy
AUTHOR
Sean A. Irvine, Jun 23 2025
STATUS
approved