login
A385335
Consecutive states of the linear congruential pseudo-random number generator (1741*s + 2731) mod 12960 when started at s=1.
2
1, 4472, 12483, 1714, 6005, 11676, 9367, 6998, 3849, 3520, 971, 8442, 3613, 7364, 6015, 3166, 6737, 3048, 8659, 5570, 6021, 652, 10343, 8454, 11545, 1616, 3867, 8938, 11789, 11700, 12271, 8462, 12513, 2104, 11075, 12786, 10837, 188, 6039, 6070, 8201, 11712
OFFSET
1,2
COMMENTS
Periodic with period 12960.
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) = (1741 * a(n-1) + 2731) mod 12960.
MAPLE
a:= proc(n) option remember; `if`(n<2, n,
irem(1741*a(n-1)+2731, 12960))
end:
seq(a(n), n=1..44); # after Alois P. Heinz
MATHEMATICA
NestList[Mod[1741*# + 2731, 12960] &, 1, 50] (* after Paolo Xausa *)
CROSSREFS
Sequence in context: A221007 A203938 A345181 * A375938 A235890 A237775
KEYWORD
nonn,look,easy
AUTHOR
Sean A. Irvine, Jun 25 2025
STATUS
approved