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.

A384194 Consecutive states of the linear congruential pseudo-random number generator 259*s mod 2^15 when started at s=1.

Original entry on oeis.org

1, 259, 1545, 6939, 27729, 5619, 13529, 30603, 29089, 30179, 17577, 30459, 24561, 4307, 1401, 2411, 1857, 22211, 18249, 7899, 14225, 14259, 23065, 10059, 16609, 9123, 3561, 4795, 29489, 2707, 12985, 20779, 7809, 23683, 6281, 21147, 4817, 2419, 3929, 1803, 8225
Offset: 1

Views

Author

Sean A. Irvine, May 21 2025

Keywords

Comments

Periodic with period 8192 (considerably less than the modulus).
A 16-bit version of RANDU (A096555) that suffers from all the same problems.

References

  • Byron S. Gottfried, Schaum's Outline of Theory and Problems of Programming with Pascal, McGraw-Hill, 1985 (see p. 143).

Crossrefs

Programs

  • Maple
    a:= proc(n) option remember; `if`(n<2, n,
          irem(259*a(n-1), 2^15))
        end:
    seq(a(n), n=1..41);  # Alois P. Heinz, May 21 2025
  • Mathematica
    NestList[Mod[259*#, 2^15] &, 1, 100] (* Paolo Xausa, May 22 2025 *)

Formula

a(n) = 259 * a(n-1) mod 2^15.