login
A384158
Consecutive states of the linear congruential pseudo-random number generator for 16-bit WATFOR/WATFIV when started at 1.
8
1, 253, 31241, 6885, 5201, 5133, 20697, 26229, 16801, 23581, 2217, 3845, 22513, 26925, 29049, 9365, 10049, 19261, 23369, 14117, 32657, 4685, 5657, 22197, 12513, 20061, 29161, 4933, 2865, 3949, 16057, 31957, 24193, 25981, 19593, 9061, 31441, 24717, 27481, 5877
OFFSET
1,2
COMMENTS
Periodic with period 8192 (considerably less than the modulus).
WATFOR and WATFIV are early FORTRAN compilers from the University of Waterloo.
REFERENCES
Terry M. Walker, Fundamentals of Fortran Programming: with WATFOR/WATFIV, Allyn and Bacon, 1975.
FORMULA
a(n) = 253 * a(n-1) mod 2^15.
a(n) == 1 (mod 4). - Hugo Pfoertner, May 26 2025
MAPLE
a:= proc(n) option remember; `if`(n<2, n,
irem(253*a(n-1), 2^15))
end:
seq(a(n), n=1..40); # Alois P. Heinz, May 21 2025
MATHEMATICA
NestList[Mod[253*#, 2^15] &, 1, 100] (* Paolo Xausa, May 22 2025 *)
CROSSREFS
Cf. A096550-A096561 other pseudo-random number generators.
Sequence in context: A271985 A391913 A255182 * A176087 A006060 A077695
KEYWORD
nonn,easy
AUTHOR
Sean A. Irvine, May 20 2025
STATUS
approved