just generate random noimbres, the same seed and max will always generate the same numbers, no kidding
I don't recommend a max from 1-5. Only 38 blocks