From 78752e3b9001e91f7cc66bcb889f899c8ca2b327 Mon Sep 17 00:00:00 2001 From: Mattrixwv Date: Wed, 30 Jun 2021 18:33:57 -0400 Subject: [PATCH] Fixed some typoes --- Algorithms.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Algorithms.py b/Algorithms.py index c8bd384..00a8733 100644 --- a/Algorithms.py +++ b/Algorithms.py @@ -31,17 +31,17 @@ def primeGenerator(): #Return 2 the first time, this lets us skip all even numbers later yield 2 - #Map composite integers to primes witnessing their compositeness + #Dictionary to hold the primes we have already found dict = {} #Start checking for primes with the number 3 and skip all even numbers for possiblePrime in itertools.count(3, 2): - #If q is not in the dictionary it is a new prime number - #Return it and mark it's next multiple + #If possiblePrime is not in the dictionary it is a new prime number + #Return it and mark its next multiple if possiblePrime not in dict: yield possiblePrime dict[possiblePrime * possiblePrime] = [possiblePrime] - #If q is in the dictionary it is a composite number + #If possiblePrime is in the dictionary it is a composite number else: #Move each witness to it's next multiple for num in dict[possiblePrime]: