OFFSET
1,2
COMMENTS
Periodic with period 6655.
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).
LINKS
Sean A. Irvine, Table of n, a(n) for n = 1..6655
W. E. Sharp and Carter Bays, A review of portable random number generators, Computers and Geosciences, 18, 1 (1982), 79-87.
FORMULA
a(n) = (936 * a(n-1) + 1399) mod 6655.
MAPLE
a:= proc(n) option remember; `if`(n<2, n,
irem(936*a(n-1)+1399, 6655))
end:
seq(a(n), n=1..44); # after Alois P. Heinz
MATHEMATICA
NestList[Mod[936*# + 1399, 6655] &, 1, 50] (* Paolo Xausa, Jun 16 2025 *)
CROSSREFS
KEYWORD
AUTHOR
Sean A. Irvine, Jun 14 2025
STATUS
approved
