cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

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.

Original entry on oeis.org

1, 1103527590, 377401575, 662824084, 1147902781, 2035015474, 368800899, 1508029952, 486256185, 1062517886, 267834847, 180171308, 836760821, 595337866, 790425851, 2111915288, 1149758321, 1644289366, 1388290519, 1647418052, 1675546029
Offset: 1

Views

Author

Hugo Pfoertner, Jul 18 2004

Keywords

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.

Crossrefs

Cf. A096550-A096561 (other pseudo-random number generators).

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.