num_retries = 3
for trynum in range(num_retries):
    it = MaxLengthLFSR(1, 16, 2000)
seq = []
for x in range(sample_count):
    seq.append(next(it))
seq = [str(x) for x in seq]
print('try %s: %s...' % (trynum + 1, ', '.join(seq)))
How to generate a predictable shuffling of a sequence without generating the whole sequence in advance?