login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A096554 Output of the linear congruential pseudo-random number generator used in function rand() as described in Kernighan and Ritchie. 0
0, 21468, 9988, 22117, 3498, 16927, 16045, 19741, 12122, 8410, 12261, 27052, 5659, 9758, 21087, 25875, 32368, 26233, 15212, 17661, 20496, 8191, 23065, 23471, 32096, 10781, 14596, 23212, 24244, 5661, 514, 25643, 1350, 19576, 8051, 18234, 16882 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,2
REFERENCES
Brian W Kernighan and Dennis M. Ritchie, The C Programming Language (Second Edition) Prentice Hall Software Series, 1988
LINKS
FORMULA
x(1)=1, x(n)=(1103515245 * x(n-1) + 12345) mod 2^31 a(n)=floor(x(n)/2^16)
PROG
(C) static unsigned int next = 1; int rand( ) { next = next * 1103515245 + 12345; return ((next >>16) & 32767); }
(PARI) x(n) = if(n<1, 0, (1103515245 * x(n-1) + 12345) % (2^31));
vector(100, n, floor(x(n)/2^16)) \\ Altug Alkan, Oct 05 2015
CROSSREFS
Cf. A096550-A096561 for other pseudo-random number generators.
Sequence in context: A255090 A237409 A252102 * A295994 A063388 A252393
KEYWORD
nonn
AUTHOR
Hugo Pfoertner, Jul 18 2004
EXTENSIONS
Wrong comment removed by Jean-Claude Arbaut, Oct 05 2015
STATUS
approved

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

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 25 04:42 EDT 2024. Contains 371964 sequences. (Running on oeis4.)