You get Sets of varying size because you generate N numbers not N unique numbers. Use a Set of 3 for example: if RNG gives a 4 it is added to the Set. Then 9 is generated and added. Then 4 is...