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.

A385459 Consecutive internal states of the linear congruential pseudo-random number generator (3877*s + 29573) mod 139968 when started at 1.

Original entry on oeis.org

1, 33450, 104855, 85336, 132861, 49430, 53491, 121572, 91961, 63874, 65679, 65264, 135925, 31278, 82091, 9148, 84465, 115226, 122887, 11400, 137453, 76678, 18147, 121556, 29929, 30834, 40319, 2080, 115557, 6494, 12571, 58476, 132833, 80842, 65655, 112184
Offset: 1

Views

Author

Sean A. Irvine, Jun 29 2025

Keywords

Comments

Periodic with period 139968.
Described in Numerical Recipes as a "quick and dirty" generator.

References

  • William H. Press, Saul A. Teukolsky, William T. Vetterling, and Brian P. Flannery, Numerical Recipes in C (2nd ed), Cambridge University Press, 1999 (see p. 285).

Crossrefs

Programs

  • Maple
    a:= proc(n) option remember; `if`(n<2, n,
          irem(3877*a(n-1)+29573, 139968))
        end:
    seq(a(n), n=1..45);  # after Alois P. Heinz
  • Mathematica
    NestList[Mod[3877*# + 29573, 139968] &, 1, 50]

Formula

a(n) = (3877*a(n-1) + 29573) mod 139968.