diff --git a/Algorithms.py b/Algorithms.py index 6cfdc62..26fa100 100644 --- a/Algorithms.py +++ b/Algorithms.py @@ -52,12 +52,13 @@ def primeGenerator(): #Skip all multiples of 2 possiblePrime += 2 +#Generate an inifinite sequence of fibonacci numbers def fibGenerator(): - #The first and second fibonacci numbers are 1 and 1 - a, b = 1, 1 + #Set this so the first returned number is 1 and the second is also 1 + a, b = 0, 1 while(True): - yield a + yield b a, b = b, a + b #This function returns a list with all the prime numbers <= goalNumber