@pieter-paul Here is the expected RNG in Python:
class RNG:
def __init__(self, seed):
self.s = seed
def __call__(self):
self.s = ((214013*self.s + 2531011) & 0xffffffff) >> 16
return self.s
rand = RNG(31)
print([rand() for _ in range(5)]) # [139, 492, 1645, 5410, 17705]
(& 0xffffffff is equivalent to % 2**32)