@skirpichev @asmeurer @smichr Suppose you have a list which a lot elements leading to using more memory than allotted by the OS. What will you do in such a case ? I guess you might have faced this problem before. I am thinking of writing the elements into a file. Do you know of any better method ? BTW i am asking this because in some cases the list generated by the takenouchi algorithm has so many elements that it throws up MemoryError.