login
The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A096558 Output of the linear congruential pseudo-random number generator rand() used in Microsoft's Visual C++. 5
0, 38, 7719, 21238, 2437, 8855, 11797, 8365, 32285, 10450, 30612, 5853, 28100, 1142, 281, 20537, 15921, 8945, 26285, 2997, 14680, 20976, 31891, 21655, 25906, 18457, 1323, 28881, 2240, 9725, 32278, 2446, 590, 840, 18587, 16907, 21237, 23611, 12617 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,2

LINKS

Alois P. Heinz, Table of n, a(n) for n = 1..10000

Index entries for sequences related to pseudo-random numbers.

FORMULA

b(1)=0, b(n)=(b(n-1) * 214013 + 2531011) mod 2^32. a(n)= (floor(b(n)/65536)) mod 32768). The sequence is periodic with period length 2^32.

a(n) = floor(A096557(n)/2^16) mod 2^15 = floor((2531011*(214013^(n-1)-1)/214012 mod 2^32)/2^16) mod 2^15. - M. F. Hasler, May 14 2015

MAPLE

b:= proc(n) option remember; `if`(n<2, 0,

      irem(214013 *b(n-1) +2531011, 4294967296))

    end:

a:= n-> irem(iquo(b(n), 65536), 32768):

seq(a(n), n=1..50);  # Alois P. Heinz, Jun 10 2014

PROG

(PARI) a(n)=A096557(n)>>16%2^15 \\ M. F. Hasler, May 14 2015

(PARI) A096558(n)=lift((Mod(214013, 2^34)^(n-1)-1)*13129821757)>>18%32768 \\ M. F. Hasler, May 14 2015

CROSSREFS

Cf. A096557 corresponding internal states. A096550-A096561 other pseudo-random number generators.

Sequence in context: A229523 A173133 A221354 * A145120 A183581 A030260

Adjacent sequences:  A096555 A096556 A096557 * A096559 A096560 A096561

KEYWORD

nonn

AUTHOR

Hugo Pfoertner, Jul 21 2004

STATUS

approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified September 21 15:50 EDT 2020. Contains 337272 sequences. (Running on oeis4.)