Mathematica has a number of built-in functions that generate lists, such as Permutations. Is there is universal way to generate only portions of these lists at a time?
My specific situation: I can find the solution to a particular problem by running a loop through all outcomes of Permutations[Range[13],{10}]. However, the size of that list is big enough that it brings my machine to a crawl.
Since Mathematica generates that list algorithmically (somehow), is it possible instead to have it generate, say, only the first 10,000 elements of the list, then the next 10,000, etc., reducing the amount that is stored in memory?
Permutations[Range[13],{10}][[Range[10000]]] would, in my mind, first generate the entire list then pull off the first 10,000 elements, not what I want to do.
Ultimately, I don't care about the Permutations function specifically. Rather, my question is as stated in the second sentence: is there a way to only generate portions of a list?
Sort; No way to pick off the first $n$ elements unless you use certain (inefficient) sorting routines. – David G. Stork Dec 22 '16 at 21:58