A384085 Consecutive states of the linear congruential pseudo-random number generator (40*s+725) mod 729 when started at s=1.
1, 36, 707, 574, 357, 425, 229, 408, 278, 181, 675, 23, 187, 186, 146, 4, 156, 404, 118, 342, 554, 286, 501, 353, 265, 390, 287, 541, 495, 113, 142, 573, 317, 283, 381, 656, 721, 405, 158, 484, 402, 38, 58, 129, 53, 658, 72, 689, 583, 717, 245, 319, 363, 665
Offset: 1
References
- Walter J. Savitch, Pascal: An Introduction to the Art and Science of Programming, Benjamin Cummings, 1984 (see p. 244).
Links
- Sean A. Irvine, Table of n, a(n) for n = 1..729
- Stephen K. Park and Keith W. Miller, Random number generators: good ones are hard to find, Communications of the ACM, Vol 31, 10 (1988), 192-201.
- Index entries for sequences related to pseudo-random numbers.
- Index entries for linear recurrences with constant coefficients, order 729.
Programs
-
Maple
a:= proc(n) option remember; `if`(n<2, n, irem(40*a(n-1)+725, 729)) end: seq(a(n), n=1..54); # Alois P. Heinz, May 18 2025
-
Mathematica
NestList[Mod[40*# + 725, 729] &, 1, 100] (* Paolo Xausa, May 22 2025 *)
Formula
a(n) = (40*a(n-1) + 725) mod 729.
Comments