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.

Original entry on oeis.org

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

Views

Author

Sean A. Irvine, May 19 2025

Keywords

Comments

Periodic with period 4096.

References

  • W. F. Clocksin and C. S. Mellish, Programming in Prolog, Springer-Verlag, 1981 (see p. 149).

Crossrefs

Cf. A096550-A096561 other pseudo-random number generators.

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.