How to implement an efficient infinite generator of prime numbers in Python?

后端 未结 13 2441
醉酒成梦
醉酒成梦 2020-11-22 01:50

This is not a homework, I am just curious.

INFINITE is the key word here.

I wish to use it as for p in primes(). I believe that this is a built-

13条回答
  •  滥情空心
    2020-11-22 02:30

    I wrote an article about an infinite primes generator some times ago:

    http://stacktrace.it/2008/01/progetto-eulero-problema-3/

    It's in Italian but you may have a pesky translation using Google: http://tinyurl.com/yzpyeom

提交回复
热议问题