|
|
A096553
|
|
Consecutive states of the linear congruential pseudo-random number generator used in function rand() in the Standard C library (VAX C) when started at 1.
|
|
1
|
|
|
1, 1103527590, 377401575, 662824084, 1147902781, 2035015474, 368800899, 1508029952, 486256185, 1062517886, 267834847, 180171308, 836760821, 595337866, 790425851, 2111915288, 1149758321, 1644289366, 1388290519, 1647418052, 1675546029
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,2
|
|
COMMENTS
|
This is also the sequence of internal states of the generator described in Kernighan and Ritchie, which produces output limited to 15bit, see A061364. - A-number corrected by Jean-Claude Arbaut, Oct 05 2015
|
|
REFERENCES
|
Brian W Kernighan and Dennis M. Ritchie, The C Programming Language (Second Edition) Prentice Hall Software Series, 1988.
|
|
LINKS
|
|
|
FORMULA
|
a(1)=1, a(n) = (1103515245 * a(n-1) + 12345) mod 2^31.
|
|
MAPLE
|
a:= proc(n) option remember; `if`(n<2, n,
irem(1103515245 *a(n-1)+12345, 2147483648))
end:
|
|
MATHEMATICA
|
With[{c=2^31}, NestList[Mod[1103515245#+12345, c]&, 1, 20]] (* Harvey P. Dale, Aug 01 2012 *)
|
|
PROG
|
(PARI) a(n) = if(n<2, 1, (1103515245 * a(n-1) + 12345) % (2^31));
(Magma) [n eq 1 select 1 else (1103515245 * Self(n-1) + 12345) mod (2^31): n in [1..25]]; // Vincenzo Librandi, Oct 06 2015
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|