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).
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.
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
KEYWORD
nonn,easy
AUTHOR
Sean A. Irvine, May 18 2025
STATUS
approved
