login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A259233
Random number table used by Doom.
1
0, 8, 109, 220, 222, 241, 149, 107, 75, 248, 254, 140, 16, 66, 74, 21, 211, 47, 80, 242, 154, 27, 205, 128, 161, 89, 77, 36, 95, 110, 85, 48, 212, 140, 211, 249, 22, 79, 200, 50, 28, 188, 52, 140, 202, 120, 68, 145, 62, 70, 184, 190, 91, 197, 152, 224, 149
OFFSET
0,2
COMMENTS
From Simon Howard, Oct 25 2024: (Start)
The same table of numbers is also used in earlier games by id Software, including Catacomb 3D (1991) and Wolfenstein 3D (1992), but was used as early as the Commander Keen series. Due to code reuse, the table subsequently found its way into games from other companies: Apogee Software's Rise of the Triad (1995) and Raven Software's Heretic (1994) and Hexen (1995) among others.
The sequence is bytes from a 32-bit linear congruential generator using a multiplier of 134775813 and an increment of 1; these parameters were used in the pseudorandom number generators shipped with various compilers produced by Borland International, Inc. in the late 1980s. This suggests that a program built using one of these compilers was used to generate the table. (End)
FORMULA
a(n) = floor((134775813^(n+1) - 1) / 8832667615232) mod 2^8 (by sum of a geometric series). - Simon Howard, Nov 04 2024
PROG
(Python)
state = 1
for _ in range(256):
print(state >> 16, end=', ')
state = (134775813 * state + 1) % (1 << 24)
# Simon Howard, Nov 01 2024
CROSSREFS
KEYWORD
nonn,dumb,fini,full
AUTHOR
J. Hufford, Jun 29 2015
STATUS
approved