local function rand(seed) return (seed * seed // 1_000) % 1_000_000 end local seed = 675248 for i = 1, 5 do seed = rand(seed) print(seed) end