|
|
A152960
|
|
Output of linear congruential generator 134775813 for 32-bit values.
|
|
1
|
|
|
0, 1, 134775814, -596792289, 870078620, 1172187917, -1410233534, 1368768587, 694906232, 1598751577, 1828254910, 352239543, 2039224980, 303092965, -683524998, 256513635, 1259699184, -355259471, 1580146294, -967806897, 1408429452, -1298476099, -669280590
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
0,3
|
|
COMMENTS
|
A widely used pseudo-random number generator, for example all Delphi-Versions until now use it for their "Random" function.
It can be shown that the sequence has full period (its length is 2^32).
|
|
LINKS
|
|
|
FORMULA
|
a(n+1) = (134775813 * a(n) + 1) (mod 2^32) (representatives for the equivalence classes by interpreting the bit-patterns as two's complement).
|
|
MATHEMATICA
|
nn=30; t = {x = 0}; Do[x = Mod[134775813 x + 1, 2^32]; If[x > 2^31, x = x - 2^32]; AppendTo[t, x], {nn}]; t (* T. D. Noe, Dec 18 2012 *)
|
|
PROG
|
(Delphi) // implementation using Delphi's built-in random() function
var
I: Integer;
begin
Randseed:= 0;
for I:= 1 to 100 do begin
Write(Randseed, ', ');
Random;
end;
end.
|
|
CROSSREFS
|
|
|
KEYWORD
|
sign,easy
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|