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.

Showing 1-1 of 1 results.

A385335 Consecutive states of the linear congruential pseudo-random number generator (1741*s + 2731) mod 12960 when started at s=1.

Original entry on oeis.org

1, 4472, 12483, 1714, 6005, 11676, 9367, 6998, 3849, 3520, 971, 8442, 3613, 7364, 6015, 3166, 6737, 3048, 8659, 5570, 6021, 652, 10343, 8454, 11545, 1616, 3867, 8938, 11789, 11700, 12271, 8462, 12513, 2104, 11075, 12786, 10837, 188, 6039, 6070, 8201, 11712
Offset: 1

Views

Author

Sean A. Irvine, Jun 25 2025

Keywords

Comments

Periodic with period 12960.
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(1741*a(n-1)+2731, 12960))
        end:
    seq(a(n), n=1..44);  # after Alois P. Heinz
  • Mathematica
    NestList[Mod[1741*# + 2731, 12960] &, 1, 50] (* after Paolo Xausa *)

Formula

a(n) = (1741 * a(n-1) + 2731) mod 12960.
Showing 1-1 of 1 results.