in reply to Generating random 6 digit numbers

Divide the problem into two: