From 743dbe3aefd65d23a7d0c24fd085f71e98830081 Mon Sep 17 00:00:00 2001 From: Correl Roush Date: Mon, 12 Apr 2010 15:53:06 +0000 Subject: [PATCH] Minor optimization to 007 git-svn-id: file:///srv/svn/euler@27 e5f4c3ec-3c0c-11df-b522-21efaa4426b5 --- 007.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/007.py b/007.py index bba77f7..3129d24 100644 --- a/007.py +++ b/007.py @@ -1,6 +1,6 @@ def primes(limit): - primes = [] - i = 2 + primes = [2] + i = 3 while len(primes) < limit: is_prime = True for p in primes: @@ -9,7 +9,7 @@ def primes(limit): break if is_prime: primes.append(i) - i = i + 1 + i = i + 2 return primes print '6th Prime', primes(6)[-1]