OFFSET
1,2
COMMENTS
Due to a poor choice of the multiplier the generator fails most 3-d criteria for randomness. 9*a(n-2)-6*a(n-1)+a(n) = 0 mod 2^31. This was first described by George Marsaglia. The animated gif in the link demonstrates the deficient behavior. The animation shows 10000 points, each of whose coordinate triples (x,y,z) were formed from successive outputs of the generator. From a suitable view angle, it can be seen that these points do not fill the 3-D space, but lie in a few planes parallel to each other.
REFERENCES
D. E. Knuth, The Art of Computer Programming Third Edition. Vol. 2 Seminumerical Algorithms. Chapter 3.3.4 The Spectral Test, Page 107. Addison-Wesley 1997.
LINKS
Alois P. Heinz, Table of n, a(n) for n = 1..10000
Sarah Belet, 'Round the Twist, Blog Entry, Friday May 16 2014
George Marsaglia, Random numbers fall mainly in the planes, Proceedings of the National Academy of Sciences, 61, 25-28, 1968.
Hugo Pfoertner, Animation showing the deficient 3-d behavior, 2024.
Index entries for linear recurrences with constant coefficients, order 536870912.
FORMULA
a(1)=1, a(n) = 65539*a(n-1) mod 2^31. The sequence is periodic with period length 2^29.
MAPLE
a:= proc(n) option remember; `if`(n<2, n,
irem(65539 *a(n-1), 2147483648))
end:
seq(a(n), n=1..30); # Alois P. Heinz, Jun 10 2014
MATHEMATICA
NestList[Mod[#*65539, 2^31] &, 1, 50] (* Paolo Xausa, Aug 29 2024 *)
PROG
(PARI) a(n)=lift(Mod(65539, 2^31)^(n-1)) \\ Charles R Greathouse IV, Jan 13 2016
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Hugo Pfoertner, Jul 19 2004
STATUS
approved