A384114 Consecutive states of the linear congruential pseudo-random number generator (125*s+1) mod 2^12 when started at s=1.
1, 126, 3463, 2796, 1341, 3786, 2211, 1944, 1337, 3286, 1151, 516, 3061, 1698, 3355, 1584, 1393, 2094, 3703, 28, 3501, 3450, 1171, 3016, 169, 646, 2927, 1332, 2661, 850, 3851, 2144, 1761, 3038, 2919, 332, 541, 2090, 3203, 3064, 2073, 1078, 3679, 1124, 1237
Offset: 1
References
- W. F. Clocksin and C. S. Mellish, Programming in Prolog, Springer-Verlag, 1981 (see p. 149).
Links
- Sean A. Irvine, Table of n, a(n) for n = 1..4096
- 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.
- W. E. Sharp and Carter Bays, A review of portable random number generators, Computers and Geosciences, 18, 1 (1982), 79-87.
- Index entries for sequences related to pseudo-random numbers.
- Index entries for linear recurrences with constant coefficients, order 4096.
Programs
-
Maple
a:= proc(n) option remember; `if`(n<2, n, irem(125*a(n-1)+1, 2^12)) end: seq(a(n), n=1..45); # Alois P. Heinz, May 19 2025
-
Mathematica
a[1] = 1; a[n_] := a[n] = Mod[125*a[n - 1] + 1, 2^12]; Array[a, 45, 1] (* Shenghui Yang, May 19 2025 *)
Formula
a(n) = (125*a(n-1) + 1) mod 2^12.
Comments