Shortest prime number program

Christoph Zwerschke cito at online.de
Sun Feb 12 04:35:01 EST 2006


Tim Hochberg wrote:
> from itertools import count, ifilter
> def sieve(s=count(2)):
>  while 1:p=s.next();s=ifilter(p.__rmod__,s);yield p

Nice!

-- Christoph



More information about the Python-list mailing list