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.

A384113 Consecutive states of a linear congruential pseudo-random number generator for MacModula-2 when started at 1.

Original entry on oeis.org

1, 13, 169, 2197, 829, 1533, 1441, 245, 874, 2118, 2113, 2048, 1203, 1773, 2250, 1518, 1246, 21, 273, 1238, 2228, 1232, 2150, 218, 523, 2177, 569, 464, 1410, 2153, 257, 1030, 1835, 745, 441, 1111, 577, 568, 451, 1241, 2267, 1739, 1808, 394, 500, 1878, 1304
Offset: 1

Views

Author

Sean A. Irvine, May 19 2025

Keywords

Comments

An example of a terrible random number generator.
Periodic with period 1155 (well below the modulus 2311).

References

  • Modula Corporation, MacModula-2 System Reference Manual, 1985 (see p. 41).

Crossrefs

Cf. A001022.
Cf. A096550-A096561 other pseudo-random number generators.
Cf. A383809 (another generator with a similar problem).

Programs

  • Maple
    a:= proc(n) option remember; `if`(n<2, n,
          irem(13*a(n-1), 2311))
        end:
    seq(a(n), n=1..47);  # Alois P. Heinz, May 21 2025
  • Mathematica
    NestList[Mod[13*#, 2311] &, 1, 100] (* Paolo Xausa, May 22 2025 *)
  • PARI
    my(f=Mod(13,2311)); a(n) = lift(f^((n-1) % 1155)); \\ Kevin Ryde, May 25 2025

Formula

a(n) = 13 * a(n-1) mod 2311.