generating a sequence and shuffling may be what you want, however its not necessarily the same as generating random numbers and discarding ones that have occurred before. For example, if you want 10 unique random numbers from between 1 and 2 million you obviously won't get the desired distribution by just generating
1,000,000
1,000,001
1,000,002
1,000,003
1,000,004
1,000,005
1,000,006
1,000,007
1,000,008
1,000,009
and shuffling those.
You could instead generate random numbers from the desired range until you have the number desired, then sort and unique the results, and then generate enough additional random number to make up whatever was eliminated by the uniquing (ensuring the new numbers are unique as you go). If the range of generated numbers isn't that much larger than the number of values you want then you might just generate some extra values to start off with. In any case the final step once you have the desired number of unique values, is to shuffle them so they are not in sorted order.