For those interested in the Sieve of Eratosthenes, have a look at:
http://www.cs.hmc.edu/~oneill/papers/Sieve-JFP.pdf
The examples in the paper are in Haskell, but I have been
corresponding with the author who provided this Python version:
def sieve():
innersieve = sieve()
prevsquare = 1
On Jan 16, 12:42 pm, Mark Hahnenberg wrote:
> When I execute this code, the numbers 2,3,4,...,11 are printed (i.e.
> nothing gets filtered out). Could anyone explain why this is
> happening? I generally understand generators, and my hypothesis is
> that reassigning to nats the result of filterin