How to read a chunk of lines from a file in Python
This article shows a Python generator that lets you read lines from a file, splitting it up in chucks, or blocks, to let you easily parallelize a program to analyze a very large file, without having to split that file in separate smaller files first.
Looking for squarefree numbers
A friend proposed an interesting problem the other day: to find out how many numbers are there below N with at most one of each prime as a factor? These numbers are called square-free numbers, because they are not divisible by any square number. If a number is divisible by any larger power of some prime […]