Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #81477
| References | (2 earlier) <002501d00733$6995dce0$3cc196a0$@gmail.com> <mailman.16191.1416757555.18130.python-list@python.org> <roy-B11F64.10563923112014@news.panix.com> <07f25264-1286-4d98-820c-949dba711248@googlegroups.com> <5472b74d$0$12979$c3e8da3$5496439d@news.astraweb.com> |
|---|---|
| Date | 2014-11-24 16:42 -0800 |
| Subject | Re: Comprehension with two variables - explanation needed |
| From | Dan Stromberg <drsalists@gmail.com> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.16260.1416876136.18130.python-list@python.org> (permalink) |
On Sun, Nov 23, 2014 at 8:42 PM, Steven D'Aprano <steve@pearwood.info> wrote: > On Sun, 23 Nov 2014 08:45:39 -0800, Rustom Mody wrote: >> First a one-line solution in haskell >> >> sieve (p:xs) = p:sieve [x | x <- xs, x `mod` p /= 0] > > Don't use that! That is a horribly inefficient way to generate primes. > > Mathematically, it is a version of Euler's Sieve. It is sometimes wrongly > described as "Sieve of Eratosthenes", but that is wrong. Due to it's > horrible performance, Melissa O'Neill calls this the "Sleight on > Eratosthenes": I don't read Haskell, but here's a Sieve (or at least I thought it was a Sieve) and a few other prime-related things: http://stromberg.dnsalias.org/~dstromberg/primes/
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Comprehension with two variables - explanation needed "Ivan Evstegneev" <webmailgroups@gmail.com> - 2014-11-23 16:56 +0200
Re: Comprehension with two variables - explanation needed Rustom Mody <rustompmody@gmail.com> - 2014-11-23 07:09 -0800
RE: Comprehension with two variables - explanation needed "Ivan Evstegneev" <webmailgroups@gmail.com> - 2014-11-23 17:37 +0200
Re: Comprehension with two variables - explanation needed Chris Angelico <rosuav@gmail.com> - 2014-11-24 02:42 +1100
RE: Comprehension with two variables - explanation needed Skip Montanaro <skip.montanaro@gmail.com> - 2014-11-23 09:45 -0600
Re: Comprehension with two variables - explanation needed Roy Smith <roy@panix.com> - 2014-11-23 10:57 -0500
Re: Comprehension with two variables - explanation needed Rustom Mody <rustompmody@gmail.com> - 2014-11-23 08:45 -0800
Re: Comprehension with two variables - explanation needed Rustom Mody <rustompmody@gmail.com> - 2014-11-23 09:17 -0800
RE: Comprehension with two variables - explanation needed "Ivan Evstegneev" <webmailgroups@gmail.com> - 2014-11-23 19:27 +0200
Re: Comprehension with two variables - explanation needed Steven D'Aprano <steve@pearwood.info> - 2014-11-24 04:42 +0000
Re: Comprehension with two variables - explanation needed Chris Angelico <rosuav@gmail.com> - 2014-11-24 15:51 +1100
Re: Comprehension with two variables - explanation needed Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-11-25 09:20 +1100
Re: Comprehension with two variables - explanation needed Rustom Mody <rustompmody@gmail.com> - 2014-11-23 22:47 -0800
Re: Comprehension with two variables - explanation needed Dan Stromberg <drsalists@gmail.com> - 2014-11-24 16:42 -0800
Re: Comprehension with two variables - explanation needed Skip Montanaro <skip.montanaro@gmail.com> - 2014-11-23 10:45 -0600
Re: Comprehension with two variables - explanation needed Roy Smith <roy@panix.com> - 2014-11-23 12:08 -0500
Re: Comprehension with two variables - explanation needed Jon Ribbens <jon+usenet@unequivocal.co.uk> - 2014-11-23 17:46 +0000
csiph-web