cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A384114 Consecutive states of the linear congruential pseudo-random number generator (125*s+1) mod 2^12 when started at s=1.

This page as a plain text file.
%I A384114 #16 Jul 06 2025 17:47:53
%S A384114 1,126,3463,2796,1341,3786,2211,1944,1337,3286,1151,516,3061,1698,
%T A384114 3355,1584,1393,2094,3703,28,3501,3450,1171,3016,169,646,2927,1332,
%U A384114 2661,850,3851,2144,1761,3038,2919,332,541,2090,3203,3064,2073,1078,3679,1124,1237
%N A384114 Consecutive states of the linear congruential pseudo-random number generator (125*s+1) mod 2^12 when started at s=1.
%C A384114 Periodic with period 4096.
%D A384114 W. F. Clocksin and C. S. Mellish, Programming in Prolog, Springer-Verlag, 1981 (see p. 149).
%H A384114 Sean A. Irvine, <a href="/A384114/b384114.txt">Table of n, a(n) for n = 1..4096</a>
%H A384114 Stephen K. Park and Keith W. Miller, <a href="https://doi.org/10.1145/63039.63042">Random number generators: good ones are hard to find</a>, Communications of the ACM, Vol 31, 10 (1988), 192-201.
%H A384114 W. E. Sharp and Carter Bays, <a href="https://doi.org/10.1016/0098-3004(92)90060-5">A review of portable random number generators</a>, Computers and Geosciences, 18, 1 (1982), 79-87.
%H A384114 <a href="/index/Ps#PRN">Index entries for sequences related to pseudo-random numbers.</a>
%H A384114 <a href="/index/Rec#order_4096">Index entries for linear recurrences with constant coefficients</a>, order 4096.
%F A384114 a(n) = (125*a(n-1) + 1) mod 2^12.
%p A384114 a:= proc(n) option remember; `if`(n<2, n,
%p A384114       irem(125*a(n-1)+1, 2^12))
%p A384114     end:
%p A384114 seq(a(n), n=1..45);  # _Alois P. Heinz_, May 19 2025
%t A384114 a[1] = 1; a[n_] := a[n] = Mod[125*a[n - 1] + 1, 2^12]; Array[a, 45, 1] (* _Shenghui Yang_, May 19 2025 *)
%Y A384114 Cf. A096550-A096561 other pseudo-random number generators.
%K A384114 nonn,easy
%O A384114 1,2
%A A384114 _Sean A. Irvine_, May 19 2025