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
KEYWORD
nonn
AUTHOR
Eric M. Schmidt, Jan 19 2013
STATUS
approved