login
A384085
Consecutive states of the linear congruential pseudo-random number generator (40*s+725) mod 729 when started at s=1.
2
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,2
COMMENTS
Periodic with period 729.
Originally defined by Savitch in the form (40*s+3641) mod 729, even though 3641 > 729.
REFERENCES
Walter J. Savitch, Pascal: An Introduction to the Art and Science of Programming, Benjamin Cummings, 1984 (see p. 244).
FORMULA
a(n) = (40*a(n-1) + 725) mod 729.
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 *)
CROSSREFS
Cf. A096550-A096561 other pseudo-random number generators.
Sequence in context: A004419 A396038 A268900 * A185491 A220758 A054339
KEYWORD
nonn,easy
AUTHOR
Sean A. Irvine, May 18 2025
STATUS
approved