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, 1103527590, 377401575, 662824084, 1147902781, 2035015474, 368800899, 1508029952, 486256185, 1062517886, 267834847, 180171308, 836760821, 595337866, 790425851, 2111915288, 1149758321, 1644289366, 1388290519, 1647418052, 1675546029
Offset: 1
Keywords
References
- Brian W Kernighan and Dennis M. Ritchie, The C Programming Language (Second Edition) Prentice Hall Software Series, 1988.
Links
- Alois P. Heinz, Table of n, a(n) for n = 1..10000 (first 1000 terms from Harvey P. Dale)
- B. D. Ripley, Thoughts on pseudorandom number generators, J of Computational and Applied Mathematics, 31, 1 (1990), 153-163.
- Index entries for sequences related to pseudo-random numbers.
Programs
-
Magma
[n eq 1 select 1 else (1103515245 * Self(n-1) + 12345) mod (2^31): n in [1..25]]; // Vincenzo Librandi, Oct 06 2015
-
Maple
a:= proc(n) option remember; `if`(n<2, n, irem(1103515245 *a(n-1)+12345, 2147483648)) end: seq(a(n), n=1..30); # Alois P. Heinz, Jun 10 2014
-
Mathematica
With[{c=2^31},NestList[Mod[1103515245#+12345,c]&,1,20]] (* Harvey P. Dale, Aug 01 2012 *)
-
PARI
a(n) = if(n<2, 1, (1103515245 * a(n-1) + 12345) % (2^31)); vector(100, n, a(n)) \\ Altug Alkan, Oct 05 2015
Formula
a(1)=1, a(n) = (1103515245 * a(n-1) + 12345) mod 2^31.
Comments