Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #77623
| Path | csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed2a.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail |
|---|---|
| Return-Path | <ian.g.kelly@gmail.com> |
| X-Original-To | python-list@python.org |
| Delivered-To | python-list@mail.python.org |
| X-Spam-Status | OK 0.021 |
| X-Spam-Evidence | '*H*': 0.96; '*S*': 0.00; 'algorithm': 0.04; 'modified': 0.07; 'odd': 0.07; 'remaining': 0.07; 'indeed,': 0.09; '2),': 0.16; 'determining': 0.16; 'limit,': 0.16; 'multiplies': 0.16; 'wrote:': 0.18; 'pointed': 0.19; 'header:In-Reply-To:1': 0.27; 'message-id:@mail.gmail.com': 0.30; 'url:wiki': 0.31; 'sep': 0.31; 'url:wikipedia': 0.31; 'run': 0.32; 'fri,': 0.33; 'test': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'done,': 0.36; 'url:org': 0.36; 'example,': 0.37; 'list': 0.37; 'step': 0.37; 'to:addr:python-list': 0.38; 'list,': 0.38; 'pm,': 0.38; 'sure': 0.39; 'to:addr:python.org': 0.39; 'numbers': 0.61; 'prime': 0.74; 'divide': 0.84; 'high,': 0.84; 'indefinitely': 0.84 |
| DKIM-Signature | v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; bh=xoVOhjWwNjHILulnV6gv6m2qjLcAeXAea/vT+xvJQdM=; b=u+Wf6zWtbZ0vAGAeh6IgfdU7eBV0giuMDQzEAO5GebPPOs/lmbRusKodl5iimNvcYt xuTmzdmwIh4Tv4MkE9ObDJepo5Hc0myvFDREa3v7bparPdmJLtDIpr0DwGahMC39FuJC +wbGj+Gbo1+++VDYnpJJEskwZuqf1QgW2YBx1+Ww+Bi4Os4z4ZSY3RyLF1asdZ2MxH8P sAi888n94lnffFdpqGZ/FAbNSRv2YWFh+YE17PyX1dVDIfI/yeJsoPLjzc+Gv1b1zQyk hbnRQXAoKdocghKRlfTKduC1xpnGrVdlcoo8eD3n3xNS5j5Z4gYsoYwvpQUUNIsEV/gj n/RQ== |
| X-Received | by 10.66.119.103 with SMTP id kt7mr25933807pab.95.1409956559058; Fri, 05 Sep 2014 15:35:59 -0700 (PDT) |
| MIME-Version | 1.0 |
| In-Reply-To | <6ebk0a95ia9llot967jf7hpmidhh6hl4fd@4ax.com> |
| References | <1enj0att6bkrnvb81rhma5dbuk3h28agl8@4ax.com> <6ebk0a95ia9llot967jf7hpmidhh6hl4fd@4ax.com> |
| From | Ian Kelly <ian.g.kelly@gmail.com> |
| Date | Fri, 5 Sep 2014 16:35:18 -0600 |
| Subject | Re: My backwards logic |
| To | Python <python-list@python.org> |
| Content-Type | text/plain; charset=UTF-8 |
| X-BeenThere | python-list@python.org |
| X-Mailman-Version | 2.1.15 |
| Precedence | list |
| List-Id | General discussion list for the Python programming language <python-list.python.org> |
| List-Unsubscribe | <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe> |
| List-Archive | <http://mail.python.org/pipermail/python-list/> |
| List-Post | <mailto:python-list@python.org> |
| List-Help | <mailto:python-list-request@python.org?subject=help> |
| List-Subscribe | <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.13813.1409956567.18130.python-list@python.org> (permalink) |
| Lines | 18 |
| NNTP-Posting-Host | 2001:888:2000:d::a6 |
| X-Trace | 1409956567 news.xs4all.nl 2957 [2001:888:2000:d::a6]:44125 |
| X-Complaints-To | abuse@xs4all.nl |
| Xref | csiph.com comp.lang.python:77623 |
Show key headers only | View raw
On Fri, Sep 5, 2014 at 3:49 PM, Seymore4Head <Seymore4Head@hotmail.invalid> wrote: > I am sure this has already been done, but after it was pointed out > that you don't need to test for any number that multiplies by 2 it > made me think again. > > If you start with the list [3,5,7] and step through the list of all > remaining odd numbers (step 2), and start appending numbers that won't > divide by numbers already appended in the list, that would seem like a > pretty efficient way to find all prime numbers. Indeed, this type of algorithm is known as a sieve. For a (literally) classical example, see http://en.wikipedia.org/wiki/Sieve_of_Eratosthenes It's a nice way to find all the prime numbers up to a given limit, or it can be modified to run indefinitely high, but it's not very efficient for determining the primality of a single number.
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
My backwards logic Seymore4Head <Seymore4Head@Hotmail.invalid> - 2014-09-05 12:48 -0400
Re: My backwards logic MRAB <python@mrabarnett.plus.com> - 2014-09-05 17:57 +0100
Re: My backwards logic Bob Gailer <bgailer@gmail.com> - 2014-09-05 13:04 -0400
Re: My backwards logic John Gordon <gordon@panix.com> - 2014-09-05 17:08 +0000
Re: My backwards logic Ethan Furman <ethan@stoneleaf.us> - 2014-09-05 10:08 -0700
Re: My backwards logic Seymore4Head <Seymore4Head@Hotmail.invalid> - 2014-09-05 13:44 -0400
Re: My backwards logic Chris Kaynor <ckaynor@zindagigames.com> - 2014-09-05 11:17 -0700
Re: My backwards logic Ian Kelly <ian.g.kelly@gmail.com> - 2014-09-05 15:04 -0600
Re: My backwards logic Chris Angelico <rosuav@gmail.com> - 2014-09-06 09:44 +1000
Re: My backwards logic Chris Kaynor <ckaynor@zindagigames.com> - 2014-09-05 10:09 -0700
Re:My backwards logic Dave Angel <davea@davea.name> - 2014-09-05 13:15 -0400
Re: My backwards logic Ian Kelly <ian.g.kelly@gmail.com> - 2014-09-05 11:17 -0600
Re: My backwards logic Juan Christian <juan0christian@gmail.com> - 2014-09-05 14:35 -0300
Re: My backwards logic Ethan Furman <ethan@stoneleaf.us> - 2014-09-05 11:41 -0700
Re: My backwards logic MRAB <python@mrabarnett.plus.com> - 2014-09-05 19:48 +0100
Re: My backwards logic Juan Christian <juan0christian@gmail.com> - 2014-09-05 16:34 -0300
Re: My backwards logic Paul Rubin <no.email@nospam.invalid> - 2014-09-05 13:07 -0700
Re: My backwards logic Rustom Mody <rustompmody@gmail.com> - 2014-09-05 18:24 -0700
Re: My backwards logic Mark Lawrence <breamoreboy@yahoo.co.uk> - 2014-09-05 20:54 +0100
Re: My backwards logic Seymore4Head <Seymore4Head@Hotmail.invalid> - 2014-09-05 17:49 -0400
Re: My backwards logic Chris Kaynor <ckaynor@zindagigames.com> - 2014-09-05 15:14 -0700
Re: My backwards logic Seymore4Head <Seymore4Head@Hotmail.invalid> - 2014-09-05 18:36 -0400
Re: My backwards logic Ian Kelly <ian.g.kelly@gmail.com> - 2014-09-05 16:35 -0600
Re: My backwards logic Seymore4Head <Seymore4Head@Hotmail.invalid> - 2014-09-05 19:05 -0400
Re: My backwards logic Dave Angel <davea@davea.name> - 2014-09-05 23:10 -0400
Re: My backwards logic Juan Christian <juan0christian@gmail.com> - 2014-09-05 22:54 -0300
Re: My backwards logic Rustom Mody <rustompmody@gmail.com> - 2014-09-05 18:58 -0700
Posting style: interleaved responses (was: My backwards logic) Ben Finney <ben+python@benfinney.id.au> - 2014-09-06 12:37 +1000
Re: Posting style: interleaved responses (was: My backwards logic) Juan Christian <juan0christian@gmail.com> - 2014-09-06 00:06 -0300
Re: Posting style: interleaved responses (was: My backwards logic) Zachary Ware <zachary.ware+pylist@gmail.com> - 2014-09-05 23:04 -0500
Re: My backwards logic Mark Lawrence <breamoreboy@yahoo.co.uk> - 2014-09-06 08:45 +0100
Re: My backwards logic Denis McMahon <denismfmcmahon@gmail.com> - 2014-09-06 07:49 +0000
Prime testing [was Re: My backwards logic] Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-09-06 20:38 +1000
Re: Prime testing [was Re: My backwards logic] Chris Angelico <rosuav@gmail.com> - 2014-09-06 20:42 +1000
Re: Prime testing [was Re: My backwards logic] Manolo Martínez <manolo@austrohungaro.com> - 2014-09-06 12:53 +0200
Re: Prime testing [was Re: My backwards logic] Peter Pearson <pkpearson@nowhere.invalid> - 2014-09-07 18:53 +0000
Re: Prime testing [was Re: My backwards logic] Manolo Martínez <manolo@austrohungaro.com> - 2014-09-07 21:09 +0200
Re: Prime testing [was Re: My backwards logic] Dan Stromberg <drsalists@gmail.com> - 2014-09-07 20:23 -0700
Re: Posting style: interleaved responses Mark Lawrence <breamoreboy@yahoo.co.uk> - 2014-09-06 08:46 +0100
csiph-web