|
Search: id:A061364
|
|
|
| A061364 |
|
Pseudo-random numbers: a (very weak) pseudo-random number generator from the second edition of the C book. |
|
+0 4
|
|
| 16838, 5758, 10113, 17515, 31051, 5627, 23010, 7419, 16212, 4086, 2749, 12767, 9084, 12060, 32225, 17543, 25089, 21183, 25137, 25566, 26966, 4978, 20495, 10311, 11367, 30054, 17031, 13145, 19882, 25736, 30524, 28505, 28394
(list; graph; listen)
|
|
|
OFFSET
|
0,1
|
|
|
COMMENT
|
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.
|
|
REFERENCES
|
Brian W. Kernighan and Dennis M. Ritchie, The C Programming Language, Second Edition, ANSI C, 1988, Prentice-Hall Internat., ch. 2.7.
Brian W. Kernighan and Dennis M. Ritchie, The C-programming-language [German], 1990, Hanser, p. 45.
|
|
LINKS
|
Harry J. Smith, Table of n, a(n) for n=0,...,1000
|
|
PROGRAM
|
/* C */ unsigned long next= 1; int i= 0; while (i++ < 33) next= next *1103515245 + 12345, printf( "%d ", (unsigned)( next/65536 ) %32768 );
(PARI) { x=1; m=2^32; for (n=0, 1000, x=(x*1103515245 + 12345)%m; write("b061364.txt", n, " ", (x\65536)%32768) ) } [From Harry J. Smith (hjsmithh(AT)sbcglobal.net), Jul 21 2009]
|
|
CROSSREFS
|
Sequence in context: A017477 A017609 A096550 this_sequence A088164 A035922 A121669
Adjacent sequences: A061361 A061362 A061363 this_sequence A061365 A061366 A061367
|
|
KEYWORD
|
easy,nonn
|
|
AUTHOR
|
Frank.Ellermann(AT)t-online.de, Jun 11 2001
|
|
|
Search completed in 0.011 seconds
|