Using too much memory

Yeah when the ranges are massive even lazy evaluation is going to eat up memory. Like others have said, thinking in terms other than evaluating each item is key for this sort of problem.