Consider the following piece of code:
m = 2; n = 6; samplesize = 1000; totalsize = 2^(n^m); numbersample = 2 RandomSample[Range[totalsize/2], samplesize];
With this I want to get a
samplesize even numbers between
totalsize. I am getting the error
SystemException["MemoryAllocationFailure"], due to the size of the list
Range[totalsize/2] (although the size of the sample I need is small). How can I modify my code to run within my memory and get the same (maybe) result?