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!)
A061364 Pseudo-random numbers: a (very weak) pseudo-random number generator from the second edition of the C book. 9

%I

%S 16838,5758,10113,17515,31051,5627,23010,7419,16212,4086,2749,12767,

%T 9084,12060,32225,17543,25089,21183,25137,25566,26966,4978,20495,

%U 10311,11367,30054,17031,13145,19882,25736,30524,28505,28394

%N Pseudo-random numbers: a (very weak) pseudo-random number generator from the second edition of the C book.

%C WATCOM C/C++ 10.0b uses this sequence for stdlib.h rand(). MS C 6.0 and gcc 2.6.3 use other (similar) sequences.

%D Brian W. Kernighan and Dennis M. Ritchie, The C Programming Language, Second Edition, ANSI C, 1988, Prentice-Hall Internat., ch. 2.7.

%D Brian W. Kernighan and Dennis M. Ritchie, The C-programming-language [German], 1990, Hanser, p. 45.

%H Harry J. Smith, <a href="/A061364/b061364.txt">Table of n, a(n) for n = 0..1000</a>

%H <a href="/index/Ps#PRN">Index entries for sequences related to pseudo-random numbers.</a>

%o (C) unsigned long next= 1; int i= 0; while (i++ < 33) next= next *1103515245 + 12345, printf( "%d ", (unsigned)( next/65536 ) %32768 );

%o (PARI) x=1; m=2^32; for (n=0, 1000, x=(x*1103515245 + 12345)%m; write("b061364.txt", n, " ", (x\65536)%32768) ) \\ _Harry J. Smith_, Jul 21 2009

%Y Cf. A061364, A096558, A221555, A221556, A221557, A221558, A221559, A221560, A221561, A221562, A260083.

%K easy,nonn

%O 0,1

%A _Frank Ellermann_, Jun 11 2001

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.)