Created
July 25, 2021 03:34
-
-
Save igorvanloo/ada4f2a9c3f5e6f5c399defc47ff6ac7 to your computer and use it in GitHub Desktop.
Problem 46
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def goldbachs(number): | |
for x in range(1, int(math.sqrt(number))+1): | |
temp_var = number - 2*(x**2) | |
if is_prime(temp_var) == True: | |
return True | |
return False | |
def compute(): | |
count = 33 | |
while True: | |
if is_prime(count): | |
count += 2 | |
else: | |
if goldbachs(count): | |
count += 2 | |
else: | |
return count |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment