I looked at three answers, including the previous ones, but Syed and I just noticed that running Subsets[Range[n]] when $n$ is large first seems to take up a lot of memory. I hope I haven’t misunderstood. If that's the case, it goes against my original intention.
Earlier, in the question, we inquired about finding all the subsets that meet the desired conditions, and Daniel Huber provided an answer.
d = Subsets[Range[6]];
Reap[
Scan[(If[Total[#] > 15, Sow[#]]) &, d]][[2]]
I'm now wondering if, instead of retrieving all the valid subsets, we only need to find the first $k$ subsets and stop once they are found.
For example, I only want to find 5 subsets s
such that Total[s] > 15
.
The premise remains to avoid generating all subsets at once, considering memory usage.