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.

A384451 Consecutive states of the linear congruential pseudo-random number generator randq1 from Numerical Recipes when started at 1.

Original entry on oeis.org

1, 1015568748, 1586005467, 2165703038, 3027450565, 217083232, 1587069247, 3327581586, 2388811721, 70837908, 2745540835, 1075679462, 1814098701, 2536995080, 3594602695, 1009643386, 4212701329, 3697481916, 1403919595, 2931756366, 2282599509, 927463856, 448971087
Offset: 1

Views

Author

Sean A. Irvine, May 30 2025

Keywords

Comments

Periodic with period 2^32.
This generator has widespread usage because it appeared in the popular "Numerical Recipes" series of books. The multiplier 1664525 is due to Knuth and the addend 1013904223 due to Lewis.

References

  • Donald E. Knuth, The Art of Computer Programming: Vol 2, Seminumerical Algorithms (2nd ed.), 1981 (see Sections 3.2-3.3).
  • 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. 284).

Crossrefs

Cf. A384448 (same multiplier).
Cf. A096550-A096561 other pseudo-random number generators.

Programs

  • Mathematica
    NestList[Mod[1664525*# + 1013904223, 2^32] &, 1, 50] (* Paolo Xausa, Jun 04 2025 *)

Formula

a(n) = (1664525 * a(n) + 1013904223) mod 2^32.
Showing 1-1 of 1 results.