login
A221556
Consecutive values produced by the C++ minstd_rand random number generator with the default seed (1).
3
48271, 182605794, 1291394886, 1914720637, 2078669041, 407355683, 1105902161, 854716505, 564586691, 1596680831, 192302371, 1203428207, 1250328747, 1738531149, 1271135913, 1098894339, 1882556969, 2136927794, 1559527823, 2075782095, 638022372, 914937185, 1931656580
OFFSET
1,1
COMMENTS
This is a linear congruential random number generator with multiplier 48271.
LINKS
Alois P. Heinz, Table of n, a(n) for n = 1..10000 (first 1000 terms from Eric M. Schmidt)
Stephen K. Park and Keith W. Miller, Random Number Generators: Good Ones are Hard to Find, Communications of the ACM, Volume 31, Number 10 (October, 1988), pp. 1192-1201.
FORMULA
a(n) = 48271^n mod (2^31-1).
MAPLE
a:= proc(n) option remember; `if`(n=0, 1,
irem(48271 *a(n-1), 2147483647))
end:
seq(a(n), n=1..30); # Alois P. Heinz, Oct 25 2017
MATHEMATICA
f[n_] := PowerMod[48271, n, 2^31 -1]; Array[f, 23] (* Robert G. Wilson v, Nov 10 2014 *)
PROG
(C++)
#include <iostream>
#include <random>
void A221556(int max)
{
std::minstd_rand gen;
for (int i = 1; i <= max; ++i)
std::cout << i << ' ' << gen() << '\n';
}
CROSSREFS
Cf. A096550.
Sequence in context: A254778 A254724 A186592 * A227701 A253494 A253501
KEYWORD
nonn
AUTHOR
Eric M. Schmidt, Jan 19 2013
STATUS
approved