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.

A384085 Consecutive states of the linear congruential pseudo-random number generator (40*s+725) mod 729 when started at s=1.

Original entry on oeis.org

1, 36, 707, 574, 357, 425, 229, 408, 278, 181, 675, 23, 187, 186, 146, 4, 156, 404, 118, 342, 554, 286, 501, 353, 265, 390, 287, 541, 495, 113, 142, 573, 317, 283, 381, 656, 721, 405, 158, 484, 402, 38, 58, 129, 53, 658, 72, 689, 583, 717, 245, 319, 363, 665
Offset: 1

Views

Author

Sean A. Irvine, May 18 2025

Keywords

Comments

Periodic with period 729.
Originally defined by Savitch in the form (40*s+3641) mod 729, even though 3641 > 729.

References

  • Walter J. Savitch, Pascal: An Introduction to the Art and Science of Programming, Benjamin Cummings, 1984 (see p. 244).

Crossrefs

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

Programs

  • Maple
    a:= proc(n) option remember; `if`(n<2, n,
          irem(40*a(n-1)+725, 729))
        end:
    seq(a(n), n=1..54);  # Alois P. Heinz, May 18 2025
  • Mathematica
    NestList[Mod[40*# + 725, 729] &, 1, 100] (* Paolo Xausa, May 22 2025 *)

Formula

a(n) = (40*a(n-1) + 725) mod 729.