|
|
A096550
|
|
Consecutive internal states of the IMSL pseudo-random number generator RNUN when started with ISEED=1.
|
|
14
|
|
|
1, 16807, 282475249, 1622650073, 984943658, 1144108930, 470211272, 101027544, 1457850878, 1458777923, 2007237709, 823564440, 1115438165, 1784484492, 74243042, 114807987, 1137522503, 1441282327, 16531729, 823378840, 143542612
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,2
|
|
COMMENTS
|
This generator is also called "The minimal standard generator" or LCG16807 by L'Ecuyer. Generators of this form are ascribed to D. H. Lehmer, first described by Hutchinson and independently by Downham and Roberts (see link). It was first analyzed by Lewis, Goodman and Miller (see link).
|
|
REFERENCES
|
D. W. Hutchinson, A new uniform pseudo-random number generator. Comm, ACM 9, No. 6, 432-433, 1966.
D. E. Knuth, The Art of Computer Programming Third Edition. Vol. 2 Seminumerical Algorithms. Chapter 3.3.4 The Spectral Test, Page 108. Addison-Wesley 1997.
|
|
LINKS
|
|
|
FORMULA
|
a(1)=1, a(n) = 7^5 * a(n-1) mod (2^31-1). The sequence is periodic with period length 2^31-2.
|
|
MAPLE
|
a:= proc(n) option remember; `if`(n<2, n,
irem(16807 *a(n-1), 2147483647))
end:
|
|
PROG
|
(C++)
#include <iostream>
#include <random>
{
std::minstd_rand0 gen;
std::cout << "1 1\n";
for (int i = 2; i <= max; ++i)
std::cout << i << ' ' << gen() << '\n';
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,easy
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|